From 9008b9e641e036b3db570f90b10033db317c7f6a Mon Sep 17 00:00:00 2001 From: Silcantar Date: Tue, 1 Jul 2025 22:36:56 -0500 Subject: [PATCH 1/6] Change default serif font weight to light. --- PrimeManual.sty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PrimeManual.sty b/PrimeManual.sty index f940f63..1b9f0fc 100644 --- a/PrimeManual.sty +++ b/PrimeManual.sty @@ -30,7 +30,7 @@ \setmainfont{RobotoSerif}[ Path = ./fonts/RobotoSerif/, Extension = .ttf, - UprightFont = *-Regular, + UprightFont = *-Light, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, From ad30cc2a41c768987f811ade66b067be787b17cf Mon Sep 17 00:00:00 2001 From: Silcantar Date: Wed, 2 Jul 2025 23:06:08 -0500 Subject: [PATCH 2/6] Change italic font to LightItalic, add figure label macro. --- PrimeManual.sty | 114 ++++++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/PrimeManual.sty b/PrimeManual.sty index 1b9f0fc..39d3a73 100644 --- a/PrimeManual.sty +++ b/PrimeManual.sty @@ -25,32 +25,34 @@ %\RequirePackage[mark]{gitinfo2} % Specify Fonts -\RequirePackage{fontspec} -% Main font: Roboto Serif -\setmainfont{RobotoSerif}[ - Path = ./fonts/RobotoSerif/, - Extension = .ttf, - UprightFont = *-Light, - BoldFont = *-Bold, - ItalicFont = *-Italic, - BoldItalicFont = *-BoldItalic, -] -% Headings & Titles font: Roboto Slab -\setsansfont{RobotoSlab}[ - Path = ./fonts/RobotoSlab/, - Extension = .ttf, - UprightFont = *-Regular, - BoldFont = *-Bold, -] -% Monospace font: Roboto Mono -\setmonofont{RobotoMono}[ - Path = ./fonts/RobotoMono/, - Extension = .ttf, - UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic, - BoldItalicFont = *-BoldItalic, -] +%#region + \RequirePackage{fontspec} + % Main font: Roboto Serif + \setmainfont{RobotoSerif}[ + Path = ./fonts/RobotoSerif/, + Extension = .ttf, + UprightFont = *-Light, + BoldFont = *-SemiBold, + ItalicFont = *-LightItalic, + BoldItalicFont = *-SemiBoldItalic, + ] + % Headings & Titles font: Roboto Slab + \setsansfont{RobotoSlab}[ + Path = ./fonts/RobotoSlab/, + Extension = .ttf, + UprightFont = *-SemiBold, + BoldFont = *-Black, + ] + % Monospace font: Roboto Mono + \setmonofont{RobotoMono}[ + Path = ./fonts/RobotoMono/, + Extension = .ttf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + ] +%#endregion % Page Layout \RequirePackage[pass]{geometry} @@ -145,28 +147,38 @@ } % Cross references -\newcommand{\refGeneral}[3][]{ - \if\relax\detokenize{#1}\relax % Check if #1 is empty string. - #3{#2}\label{ch:#2} - \else - #3{#2}\label{ch:#1} - \fi -} -\newcommand{\refChapter}[2][]{ - \refGeneral[#1]{#2}{\chapter} -} -\newcommand{\refSection}[2][]{ - \refGeneral[#1]{#2}{\section} -} -\newcommand{\refSubsection}[2][]{ - \refGeneral[#1]{#2}{\subsection} -} -\newcommand{\refSubsubsection}[2][]{ - \refGeneral[#1]{#2}{\subsubsection} -} -\newcommand{\refParagraph}[2][]{ - \refGeneral[#1]{#2}{\paragraph} -} -\newcommand{\refSubparagraph}[2][]{ - \refGeneral[#1]{#2}{\subparagraph} -} \ No newline at end of file +%#region + \newcommand{\sectionRef}[3][]{#1 \ref{#2:#3}: #3} + + \newcommand{\lblGeneral}[4][]{ + \if\relax\detokenize{#1}\relax % Check if #1 is empty string. + #3{#2}\label{#4:#2} + \else + #3{#2}\label{#4:#1} + \fi + } + \newcommand{\lblChapter}[2][]{ + \lblGeneral[#1]{#2}{\chapter}{ch} + } + \newcommand{\lblSection}[2][]{ + \lblGeneral[#1]{#2}{\section}{sec} + } + \newcommand{\lblSubsection}[2][]{ + \lblGeneral[#1]{#2}{\subsection}{subsec} + } + \newcommand{\lblSubsubsection}[2][]{ + \lblGeneral[#1]{#2}{\subsubsection}{sssec} + } + \newcommand{\lblParagraph}[2][]{ + \lblGeneral[#1]{#2}{\paragraph}{par} + } + \newcommand{\lblSubparagraph}[2][]{ + \lblGeneral[#1]{#2}{\subparagraph}{subpar} + } + \newcommand{\lblTable}[2][]{ + \textbf{\lblGeneral[#1]{#2}{\caption}{tbl}} + } + \newcommand{\lblFigure}[2][]{ + \textbf{\lblGeneral[#1]{#2}{\caption}{fig}} + } +%#endregion \ No newline at end of file From 7230d1a842fc03979647622624af16fff4dff837 Mon Sep 17 00:00:00 2001 From: Silcantar Date: Sun, 6 Jul 2025 20:25:49 -0500 Subject: [PATCH 3/6] - Add VSCode fold regions. - Add margin footnote macro. - Fix margin note vertical offset. --- PrimeManual.sty | 406 ++++++++++++++++++++++++++---------------------- 1 file changed, 223 insertions(+), 183 deletions(-) diff --git a/PrimeManual.sty b/PrimeManual.sty index 39d3a73..c4bdc82 100644 --- a/PrimeManual.sty +++ b/PrimeManual.sty @@ -1,184 +1,224 @@ -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{latex-templates/PrimeManual}[2025-06-24] -% -% Suppress warning about \showhyphens being changed. -\let\CheckCommand\providecommand - -\RequirePackage{microtype} - -\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}} - -\newcommand{\sTitle}{\makeatletter{\@title}} -\newcommand{\sAuthor}{\makeatletter{\@author}} -\newcommand{\sDate}{\makeatletter{\@date}} -\newcommand{\sCustomer}{\makeatletter{\@customer}} -\newcommand{\sCustomerFull}{\makeatletter{\@customerFull}} -\newcommand{\sProjectNumber}{\makeatletter{\@projectNumber}} -\newcommand{\sProjectDesc}{\makeatletter{\@projectDesc}} -\newcommand{\sProjectTitle}{\makeatletter{Project \@projectNumber : \@projectDesc}} -\newcommand{\sVersion}{\makeatletter{\@version}} - -%\RequirePackage[mark]{gitinfo2} - -% Specify Fonts -%#region - \RequirePackage{fontspec} - % Main font: Roboto Serif - \setmainfont{RobotoSerif}[ - Path = ./fonts/RobotoSerif/, - Extension = .ttf, - UprightFont = *-Light, - BoldFont = *-SemiBold, - ItalicFont = *-LightItalic, - BoldItalicFont = *-SemiBoldItalic, - ] - % Headings & Titles font: Roboto Slab - \setsansfont{RobotoSlab}[ - Path = ./fonts/RobotoSlab/, - Extension = .ttf, - UprightFont = *-SemiBold, - BoldFont = *-Black, - ] - % Monospace font: Roboto Mono - \setmonofont{RobotoMono}[ - Path = ./fonts/RobotoMono/, - Extension = .ttf, - UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic, - BoldItalicFont = *-BoldItalic, - ] -%#endregion - -% Page Layout -\RequirePackage[pass]{geometry} - -% Title & Heading Options -\RequirePackage[sf,raggedright]{titlesec} - -% Header & Footer Options -\pagestyle{plain} - -% Color import and definition -\RequirePackage{xcolor} -\definecolor{PrimeBlue}{RGB}{25,45,145} - -% Use Hyperref to automatically create links in the document -\RequirePackage{hyperref} -\hypersetup{colorlinks=true, allcolors=PrimeBlue} - -% Graphics package for including images -\RequirePackage{graphicx} -\RequirePackage{calc} - -% Define custom title page. -\newcommand{\PrimeTitlePage}{ - \begin{titlepage} - \begin{sffamily} - {\raggedright\noindent\large - \vspace*{\stretch{1}} - - \sCustomerFull - \medbreak - \sProjectTitle - \bigbreak - {\Huge \sTitle} - \vfill - {\leavevmode - % Move the rule graphic to 0.25 in from the left edge of the - % paper and vertically centered on the heartbeat graphic. - \put(-\oddsidemargin-0.75in,10pt){ - \includegraphics{graphics/prime_rule.pdf} - } - % The numbers here are just what looks good. - \put(100pt,0pt){ - \includegraphics{graphics/prime_heartbeat.pdf} - } - } - - \sAuthor - - Revision \sVersion - - \sDate - \vfill - } - \end{sffamily} - \end{titlepage} -} - -% Paragraph formatting. -\setlength{\parindent}{0pt} -\setlength{\parskip}{2ex plus 0.5ex minus 0.5ex} - -% Table formatting. -\renewcommand{\arraystretch}{1.5} -\RequirePackage{csvsimple} -\RequirePackage{longtable} -\RequirePackage{colortbl} -\RequirePackage{booktabs} - -% Glossary formatting. -\RequirePackage[nopostdot,toc,sort=standard]{glossaries} - -% Index formatting. -\RequirePackage{makeidx} -\RequirePackage{xstring} -\newcommand{\idx}[1]{\StrSubstitute{#1}{!}{ }\index{#1}} - -% Margin Note formatting. -\RequirePackage{marginnote} -% -38pt seems to be just the right vertical adjustment to align margin notes -% with the reference in the text. -\renewcommand{\marginnotevadjust}{-38pt} -\renewcommand{\marginfont}{\small\color{PrimeBlue}} - -\newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}} -\newcommand{\margindef}[2][0pt]{% - \index{\glsentryname{#2}}% Add a reference to this in the index. - \textbf{\gls{#2}}% This is the text that appears on the page. - \marginnote{% Create the margin note. - \margintitle{\Glsentryname{#2}:% Create the title of the margin note. - } \glsdesc*{#2}}[#1]% Create the text of the margin note. -} - -% Cross references -%#region - \newcommand{\sectionRef}[3][]{#1 \ref{#2:#3}: #3} - - \newcommand{\lblGeneral}[4][]{ - \if\relax\detokenize{#1}\relax % Check if #1 is empty string. - #3{#2}\label{#4:#2} - \else - #3{#2}\label{#4:#1} - \fi - } - \newcommand{\lblChapter}[2][]{ - \lblGeneral[#1]{#2}{\chapter}{ch} - } - \newcommand{\lblSection}[2][]{ - \lblGeneral[#1]{#2}{\section}{sec} - } - \newcommand{\lblSubsection}[2][]{ - \lblGeneral[#1]{#2}{\subsection}{subsec} - } - \newcommand{\lblSubsubsection}[2][]{ - \lblGeneral[#1]{#2}{\subsubsection}{sssec} - } - \newcommand{\lblParagraph}[2][]{ - \lblGeneral[#1]{#2}{\paragraph}{par} - } - \newcommand{\lblSubparagraph}[2][]{ - \lblGeneral[#1]{#2}{\subparagraph}{subpar} - } - \newcommand{\lblTable}[2][]{ - \textbf{\lblGeneral[#1]{#2}{\caption}{tbl}} - } - \newcommand{\lblFigure}[2][]{ - \textbf{\lblGeneral[#1]{#2}{\caption}{fig}} - } +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{latex-templates/PrimeManual}[2025-06-24] + +% Suppress warning about \showhyphens being changed. +\let\CheckCommand\providecommand + +\RequirePackage{microtype} + +% Custom document properties. +%#region + \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}} +%#endregion + +% Macros to insert document properties. +%#region + \newcommand{\sTitle}{\makeatletter{\@title}} + \newcommand{\sAuthor}{\makeatletter{\@author}} + \newcommand{\sDate}{\makeatletter{\@date}} + \newcommand{\sCustomer}{\makeatletter{\@customer}} + \newcommand{\sCustomerFull}{\makeatletter{\@customerFull}} + \newcommand{\sProjectNumber}{\makeatletter{\@projectNumber}} + \newcommand{\sProjectDesc}{\makeatletter{\@projectDesc}} + \newcommand{\sProjectTitle}{\makeatletter{Project \@projectNumber : \@projectDesc}} + \newcommand{\sVersion}{\makeatletter{\@version}} +%#endregion + +% Specify Fonts +%#region + \RequirePackage{fontspec} + % Main font: Roboto Serif + \setmainfont{RobotoSerif}[ + Path = ./fonts/RobotoSerif/, + Extension = .ttf, + UprightFont = *-Light, + BoldFont = *-SemiBold, + ItalicFont = *-LightItalic, + BoldItalicFont = *-SemiBoldItalic, + ] + % Headings & Titles font: Roboto Slab + \setsansfont{RobotoSlab}[ + Path = ./fonts/RobotoSlab/, + Extension = .ttf, + UprightFont = *-SemiBold, + BoldFont = *-Black, + ] + % Monospace font: Roboto Mono + \setmonofont{RobotoMono}[ + Path = ./fonts/RobotoMono/, + Extension = .ttf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + ] +%#endregion + +% Page Layout +%#region + \RequirePackage[pass]{geometry} +%#endregion + +% Title & Heading Options +%#region + \RequirePackage[sf,raggedright]{titlesec} +%#endregion + +% Header & Footer Options +%#region + \pagestyle{plain} +%#endregion + +% Color import and definition +%#region + \RequirePackage{xcolor} + \definecolor{PrimeBlue}{RGB}{25,45,145} +%#endregion + +% Use Hyperref to automatically create links in the document +%#region + \RequirePackage{hyperref} + \hypersetup{colorlinks=true, allcolors=PrimeBlue} +%#endregion + +% Graphics package for including images +%#region + \RequirePackage{graphicx} + \RequirePackage{calc} +%#endregion + +% Define custom title page. +%#region +\newcommand{\PrimeTitlePage}{ + \begin{titlepage} + \begin{sffamily} + {\raggedright\noindent\large + \vspace*{\stretch{1}} + + \sCustomerFull + \medbreak + \sProjectTitle + \bigbreak + {\Huge \sTitle} + \vfill + {\leavevmode + % Move the rule graphic to 0.25 in from the left edge of the + % paper and vertically centered on the heartbeat graphic. + \put(-\oddsidemargin-0.75in,10pt){ + \includegraphics{graphics/prime_rule.pdf} + } + % The numbers here are just what looks good. + \put(100pt,0pt){ + \includegraphics{graphics/prime_heartbeat.pdf} + } + } + + \sAuthor + + Revision \sVersion + + \sDate + \vfill + } + \end{sffamily} + \end{titlepage} +} +%#endregion + +% Paragraph formatting. +%#region + \setlength{\parindent}{0pt} + \setlength{\parskip}{2ex plus 0.5ex minus 0.5ex} +%#endregion + +% Table formatting. +%#region + \renewcommand{\arraystretch}{1.5} + \RequirePackage{csvsimple} + \RequirePackage{longtable} + \RequirePackage{colortbl} + \RequirePackage{booktabs} + + \newcommand{\bandedrows}{\rowcolors{2}{white}{gray!10}} +%#endregion + +% Glossary formatting. +%#region + \RequirePackage[nopostdot,toc,sort=standard]{glossaries} +%#endregion + +% Index formatting. +%#region + \RequirePackage{makeidx} + \RequirePackage{xstring} + \newcommand{\idx}[1]{\StrSubstitute{#1}{!}{ }\index{#1}} +%#endregion + +% Margin Note formatting. +%#region + \RequirePackage{marginnote} + % -38pt seems to be just the right vertical adjustment to align margin notes + % with the reference in the text. + %\renewcommand{\marginnotevadjust}{-38pt} + \renewcommand{\marginfont}{\small\color{PrimeBlue}} + + % Title formatting for margin notes. + \newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}} + + % Put a glossary definition in a margin note. + % Optional parameter is vertical adjustment of the note. + \newcommand{\margindef}[2][0pt]{% + \index{\glsentryname{#2}}% Add a reference to this in the index. + \textbf{\gls{#2}}% This is the text that appears on the page. + \marginnote{% Create the margin note. + \textsf{\textbf{ + \Glsentryname{#2}:% Create the title of the margin note. + }} + \glsdesc*{#2}}[#1]% Create the text of the margin note. + } + + % Put a footnote in a margin note. + % Optional parameter is vertical adjustment of the note. + \newcommand{\mnote}[2][0pt]{\footnotemark\marginnote{\footnotemark[\value{footnote}]#2}[#1]} +%#endregion + +% Cross references +%#region + \newcommand{\sectionRef}[3][]{#1 \ref{#2:#3}: #3} + + \newcommand{\lblGeneral}[4][]{ + \if\relax\detokenize{#1}\relax % Check if #1 is empty string. + #3{#2}\label{#4:#2} + \else + #3{#2}\label{#4:#1} + \fi + } + \newcommand{\lblChapter}[2][]{ + \lblGeneral[#1]{#2}{\chapter}{ch} + } + \newcommand{\lblSection}[2][]{ + \lblGeneral[#1]{#2}{\section}{sec} + } + \newcommand{\lblSubsection}[2][]{ + \lblGeneral[#1]{#2}{\subsection}{subsec} + } + \newcommand{\lblSubsubsection}[2][]{ + \lblGeneral[#1]{#2}{\subsubsection}{sssec} + } + \newcommand{\lblParagraph}[2][]{ + \lblGeneral[#1]{#2}{\paragraph}{par} + } + \newcommand{\lblSubparagraph}[2][]{ + \lblGeneral[#1]{#2}{\subparagraph}{subpar} + } + \newcommand{\lblTable}[2][]{ + \textbf{\lblGeneral[#1]{#2}{\caption}{tbl}} + } + \newcommand{\lblFigure}[2][]{ + \textbf{\lblGeneral[#1]{#2}{\caption}{fig}} + } %#endregion \ No newline at end of file From db32ca3235bfa4978472669d0803314aadc52bbc Mon Sep 17 00:00:00 2001 From: Silcantar Date: Sun, 6 Jul 2025 22:12:01 -0500 Subject: [PATCH 4/6] Remove formatting for tabular; add tabularray dependency. --- PrimeManual.sty | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PrimeManual.sty b/PrimeManual.sty index c4bdc82..27ae7e4 100644 --- a/PrimeManual.sty +++ b/PrimeManual.sty @@ -137,11 +137,12 @@ % Table formatting. %#region - \renewcommand{\arraystretch}{1.5} + %\renewcommand{\arraystretch}{1.5} \RequirePackage{csvsimple} \RequirePackage{longtable} \RequirePackage{colortbl} \RequirePackage{booktabs} + \RequirePackage{tabularray} \newcommand{\bandedrows}{\rowcolors{2}{white}{gray!10}} %#endregion From 73cdafc93b507e89a30d83dbbff5363e862f75ef Mon Sep 17 00:00:00 2001 From: Silcantar Date: Mon, 7 Jul 2025 22:23:46 -0500 Subject: [PATCH 5/6] Add marginfig macro. --- PrimeManual.sty | 467 +++++++++++++++++++++++++----------------------- 1 file changed, 243 insertions(+), 224 deletions(-) diff --git a/PrimeManual.sty b/PrimeManual.sty index 27ae7e4..cb70945 100644 --- a/PrimeManual.sty +++ b/PrimeManual.sty @@ -1,225 +1,244 @@ -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{latex-templates/PrimeManual}[2025-06-24] - -% Suppress warning about \showhyphens being changed. -\let\CheckCommand\providecommand - -\RequirePackage{microtype} - -% Custom document properties. -%#region - \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}} -%#endregion - -% Macros to insert document properties. -%#region - \newcommand{\sTitle}{\makeatletter{\@title}} - \newcommand{\sAuthor}{\makeatletter{\@author}} - \newcommand{\sDate}{\makeatletter{\@date}} - \newcommand{\sCustomer}{\makeatletter{\@customer}} - \newcommand{\sCustomerFull}{\makeatletter{\@customerFull}} - \newcommand{\sProjectNumber}{\makeatletter{\@projectNumber}} - \newcommand{\sProjectDesc}{\makeatletter{\@projectDesc}} - \newcommand{\sProjectTitle}{\makeatletter{Project \@projectNumber : \@projectDesc}} - \newcommand{\sVersion}{\makeatletter{\@version}} -%#endregion - -% Specify Fonts -%#region - \RequirePackage{fontspec} - % Main font: Roboto Serif - \setmainfont{RobotoSerif}[ - Path = ./fonts/RobotoSerif/, - Extension = .ttf, - UprightFont = *-Light, - BoldFont = *-SemiBold, - ItalicFont = *-LightItalic, - BoldItalicFont = *-SemiBoldItalic, - ] - % Headings & Titles font: Roboto Slab - \setsansfont{RobotoSlab}[ - Path = ./fonts/RobotoSlab/, - Extension = .ttf, - UprightFont = *-SemiBold, - BoldFont = *-Black, - ] - % Monospace font: Roboto Mono - \setmonofont{RobotoMono}[ - Path = ./fonts/RobotoMono/, - Extension = .ttf, - UprightFont = *-Regular, - BoldFont = *-Bold, - ItalicFont = *-Italic, - BoldItalicFont = *-BoldItalic, - ] -%#endregion - -% Page Layout -%#region - \RequirePackage[pass]{geometry} -%#endregion - -% Title & Heading Options -%#region - \RequirePackage[sf,raggedright]{titlesec} -%#endregion - -% Header & Footer Options -%#region - \pagestyle{plain} -%#endregion - -% Color import and definition -%#region - \RequirePackage{xcolor} - \definecolor{PrimeBlue}{RGB}{25,45,145} -%#endregion - -% Use Hyperref to automatically create links in the document -%#region - \RequirePackage{hyperref} - \hypersetup{colorlinks=true, allcolors=PrimeBlue} -%#endregion - -% Graphics package for including images -%#region - \RequirePackage{graphicx} - \RequirePackage{calc} -%#endregion - -% Define custom title page. -%#region -\newcommand{\PrimeTitlePage}{ - \begin{titlepage} - \begin{sffamily} - {\raggedright\noindent\large - \vspace*{\stretch{1}} - - \sCustomerFull - \medbreak - \sProjectTitle - \bigbreak - {\Huge \sTitle} - \vfill - {\leavevmode - % Move the rule graphic to 0.25 in from the left edge of the - % paper and vertically centered on the heartbeat graphic. - \put(-\oddsidemargin-0.75in,10pt){ - \includegraphics{graphics/prime_rule.pdf} - } - % The numbers here are just what looks good. - \put(100pt,0pt){ - \includegraphics{graphics/prime_heartbeat.pdf} - } - } - - \sAuthor - - Revision \sVersion - - \sDate - \vfill - } - \end{sffamily} - \end{titlepage} -} -%#endregion - -% Paragraph formatting. -%#region - \setlength{\parindent}{0pt} - \setlength{\parskip}{2ex plus 0.5ex minus 0.5ex} -%#endregion - -% Table formatting. -%#region - %\renewcommand{\arraystretch}{1.5} - \RequirePackage{csvsimple} - \RequirePackage{longtable} - \RequirePackage{colortbl} - \RequirePackage{booktabs} - \RequirePackage{tabularray} - - \newcommand{\bandedrows}{\rowcolors{2}{white}{gray!10}} -%#endregion - -% Glossary formatting. -%#region - \RequirePackage[nopostdot,toc,sort=standard]{glossaries} -%#endregion - -% Index formatting. -%#region - \RequirePackage{makeidx} - \RequirePackage{xstring} - \newcommand{\idx}[1]{\StrSubstitute{#1}{!}{ }\index{#1}} -%#endregion - -% Margin Note formatting. -%#region - \RequirePackage{marginnote} - % -38pt seems to be just the right vertical adjustment to align margin notes - % with the reference in the text. - %\renewcommand{\marginnotevadjust}{-38pt} - \renewcommand{\marginfont}{\small\color{PrimeBlue}} - - % Title formatting for margin notes. - \newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}} - - % Put a glossary definition in a margin note. - % Optional parameter is vertical adjustment of the note. - \newcommand{\margindef}[2][0pt]{% - \index{\glsentryname{#2}}% Add a reference to this in the index. - \textbf{\gls{#2}}% This is the text that appears on the page. - \marginnote{% Create the margin note. - \textsf{\textbf{ - \Glsentryname{#2}:% Create the title of the margin note. - }} - \glsdesc*{#2}}[#1]% Create the text of the margin note. - } - - % Put a footnote in a margin note. - % Optional parameter is vertical adjustment of the note. - \newcommand{\mnote}[2][0pt]{\footnotemark\marginnote{\footnotemark[\value{footnote}]#2}[#1]} -%#endregion - -% Cross references -%#region - \newcommand{\sectionRef}[3][]{#1 \ref{#2:#3}: #3} - - \newcommand{\lblGeneral}[4][]{ - \if\relax\detokenize{#1}\relax % Check if #1 is empty string. - #3{#2}\label{#4:#2} - \else - #3{#2}\label{#4:#1} - \fi - } - \newcommand{\lblChapter}[2][]{ - \lblGeneral[#1]{#2}{\chapter}{ch} - } - \newcommand{\lblSection}[2][]{ - \lblGeneral[#1]{#2}{\section}{sec} - } - \newcommand{\lblSubsection}[2][]{ - \lblGeneral[#1]{#2}{\subsection}{subsec} - } - \newcommand{\lblSubsubsection}[2][]{ - \lblGeneral[#1]{#2}{\subsubsection}{sssec} - } - \newcommand{\lblParagraph}[2][]{ - \lblGeneral[#1]{#2}{\paragraph}{par} - } - \newcommand{\lblSubparagraph}[2][]{ - \lblGeneral[#1]{#2}{\subparagraph}{subpar} - } - \newcommand{\lblTable}[2][]{ - \textbf{\lblGeneral[#1]{#2}{\caption}{tbl}} - } - \newcommand{\lblFigure}[2][]{ - \textbf{\lblGeneral[#1]{#2}{\caption}{fig}} - } +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{latex-templates/PrimeManual}[2025-06-24] + +% Suppress warning about \showhyphens being changed. +\let\CheckCommand\providecommand + +\RequirePackage{microtype} + +% Custom document properties. +%#region + \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}} +%#endregion + +% Macros to insert document properties. +%#region + \newcommand{\sTitle}{\makeatletter{\@title}} + \newcommand{\sAuthor}{\makeatletter{\@author}} + \newcommand{\sDate}{\makeatletter{\@date}} + \newcommand{\sCustomer}{\makeatletter{\@customer}} + \newcommand{\sCustomerFull}{\makeatletter{\@customerFull}} + \newcommand{\sProjectNumber}{\makeatletter{\@projectNumber}} + \newcommand{\sProjectDesc}{\makeatletter{\@projectDesc}} + \newcommand{\sProjectTitle}{\makeatletter{Project \@projectNumber : \@projectDesc}} + \newcommand{\sVersion}{\makeatletter{\@version}} +%#endregion + +% Specify Fonts +%#region + \RequirePackage{fontspec} + % Main font: Roboto Serif + \setmainfont{RobotoSerif}[ + Path = ./fonts/RobotoSerif/, + Extension = .ttf, + UprightFont = *-Light, + BoldFont = *-SemiBold, + ItalicFont = *-LightItalic, + BoldItalicFont = *-SemiBoldItalic, + ] + % Headings & Titles font: Roboto Slab + \setsansfont{RobotoSlab}[ + Path = ./fonts/RobotoSlab/, + Extension = .ttf, + UprightFont = *-SemiBold, + BoldFont = *-Black, + ] + % Monospace font: Roboto Mono + \setmonofont{RobotoMono}[ + Path = ./fonts/RobotoMono/, + Extension = .ttf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + ] +%#endregion + +% Page Layout +%#region + \RequirePackage[pass]{geometry} +%#endregion + +% Title & Heading Options +%#region + \RequirePackage[sf,raggedright]{titlesec} +%#endregion + +% Header & Footer Options +%#region + \pagestyle{plain} +%#endregion + +% Color import and definition +%#region + \RequirePackage{xcolor} + \definecolor{PrimeBlue}{RGB}{25,45,145} +%#endregion + +% Use Hyperref to automatically create links in the document +%#region + \RequirePackage{hyperref} + \hypersetup{colorlinks=true, allcolors=PrimeBlue} +%#endregion + +% Graphics package for including images +%#region + \RequirePackage{graphicx} + \RequirePackage{calc} +%#endregion + +% Define custom title page. +%#region +\newcommand{\PrimeTitlePage}{ + \begin{titlepage} + \begin{sffamily} + {\raggedright\noindent\large + \vspace*{\stretch{1}} + + \sCustomerFull + \medbreak + \sProjectTitle + \bigbreak + {\Huge \sTitle} + \vfill + {\leavevmode + % Move the rule graphic to 0.25 in from the left edge of the + % paper and vertically centered on the heartbeat graphic. + \put(-\oddsidemargin-0.75in,10pt){ + \includegraphics{graphics/prime_rule.pdf} + } + % The numbers here are just what looks good. + \put(100pt,0pt){ + \includegraphics{graphics/prime_heartbeat.pdf} + } + } + + \sAuthor + + Revision \sVersion + + \sDate + \vfill + } + \end{sffamily} + \end{titlepage} +} +%#endregion + +% Paragraph formatting. +%#region + \setlength{\parindent}{0pt} + \setlength{\parskip}{2ex plus 0.5ex minus 0.5ex} +%#endregion + +% Table formatting. +%#region + %\renewcommand{\arraystretch}{1.5} + \RequirePackage{csvsimple} + \RequirePackage{longtable} + \RequirePackage{colortbl} + \RequirePackage{booktabs} + \RequirePackage{tabularray} + + \newcommand{\bandedrows}{\rowcolors{2}{white}{gray!10}} +%#endregion + +% Glossary formatting. +%#region + \RequirePackage[nopostdot,toc,sort=standard]{glossaries} +%#endregion + +% Index formatting. +%#region + \RequirePackage{makeidx} + \RequirePackage{xstring} + \newcommand{\idx}[1]{\StrSubstitute{#1}{!}{ }\index{#1}} +%#endregion + +% Margin Note formatting. +%#region + \RequirePackage{marginnote} + % -38pt seems to be just the right vertical adjustment to align margin notes + % with the reference in the text. + %\renewcommand{\marginnotevadjust}{-38pt} + \renewcommand{\marginfont}{\small\color{PrimeBlue}} + + % Title formatting for margin notes. + %\newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}} + + % Put a glossary definition in a margin note. + % Optional parameter is vertical adjustment of the note. + \newcommand{\margindef}[2][0pt]{% + \index{\glsentryname{#2}}% Add a reference to this in the index. + \textbf{\gls{#2}}% This is the text that appears on the page. + \marginnote{% Create the margin note. + %\marginfont + \textsf{\textbf{ + \Glsentryname{#2}:% Create the title of the margin note. + }} + \glsdesc*{#2} + }[#1]% Create the text of the margin note. + } + + % Put a footnote in a margin note. + % Optional parameter is vertical adjustment of the note. + \newcommand{\mnote}[2][0pt]{% + \footnotemark + \marginnote{ + %\marginfont + \footnotemark[\value{footnote}]#2}[#1] + } + + \RequirePackage[hypcap=true]{caption} + \newcommand{\marginfig}[2]{% + \marginnote{ + %\marginfont + \captionsetup{type=figure} + \begin{center} + \includegraphics{#1} + \end{center} + \captionof{figure}{#2} + } + } +%#endregion + +% Cross references +%#region + \newcommand{\sectionRef}[3][]{#1 \ref{#2:#3}: #3} + + \newcommand{\lblGeneral}[4][]{ + \if\relax\detokenize{#1}\relax % Check if #1 is empty string. + #3{#2}\label{#4:#2} + \else + #3{#2}\label{#4:#1} + \fi + } + \newcommand{\lblChapter}[2][]{ + \lblGeneral[#1]{#2}{\chapter}{ch} + } + \newcommand{\lblSection}[2][]{ + \lblGeneral[#1]{#2}{\section}{sec} + } + \newcommand{\lblSubsection}[2][]{ + \lblGeneral[#1]{#2}{\subsection}{subsec} + } + \newcommand{\lblSubsubsection}[2][]{ + \lblGeneral[#1]{#2}{\subsubsection}{sssec} + } + \newcommand{\lblParagraph}[2][]{ + \lblGeneral[#1]{#2}{\paragraph}{par} + } + \newcommand{\lblSubparagraph}[2][]{ + \lblGeneral[#1]{#2}{\subparagraph}{subpar} + } + \newcommand{\lblTable}[2][]{ + \textbf{\lblGeneral[#1]{#2}{\caption}{tbl}} + } + \newcommand{\lblFigure}[2][]{ + \textbf{\lblGeneral[#1]{#2}{\caption}{fig}} + } %#endregion \ No newline at end of file From 3c57cf7d77748a39e260691c7908d107b8b9a55d Mon Sep 17 00:00:00 2001 From: Silcantar Date: Mon, 7 Jul 2025 23:28:14 -0500 Subject: [PATCH 6/6] Merge previous changes, clean up margin note formatting. --- PrimeManual.sty | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/PrimeManual.sty b/PrimeManual.sty index cb70945..2be2caf 100644 --- a/PrimeManual.sty +++ b/PrimeManual.sty @@ -89,6 +89,10 @@ %#region \RequirePackage{graphicx} \RequirePackage{calc} + + \newcommand{\ig}[2][0.5in]{ + \includegraphics[keepaspectratio,width=#1]{graphics/#2} + } %#endregion % Define custom title page. @@ -109,11 +113,11 @@ % Move the rule graphic to 0.25 in from the left edge of the % paper and vertically centered on the heartbeat graphic. \put(-\oddsidemargin-0.75in,10pt){ - \includegraphics{graphics/prime_rule.pdf} + \includegraphics{graphics/title/prime_rule.pdf} } % The numbers here are just what looks good. \put(100pt,0pt){ - \includegraphics{graphics/prime_heartbeat.pdf} + \includegraphics{graphics/title/prime_heartbeat.pdf} } } @@ -137,14 +141,8 @@ % Table formatting. %#region - %\renewcommand{\arraystretch}{1.5} - \RequirePackage{csvsimple} - \RequirePackage{longtable} - \RequirePackage{colortbl} - \RequirePackage{booktabs} \RequirePackage{tabularray} - - \newcommand{\bandedrows}{\rowcolors{2}{white}{gray!10}} + \RequirePackage{csvsimple-l3} %#endregion % Glossary formatting. @@ -162,21 +160,14 @@ % Margin Note formatting. %#region \RequirePackage{marginnote} - % -38pt seems to be just the right vertical adjustment to align margin notes - % with the reference in the text. - %\renewcommand{\marginnotevadjust}{-38pt} \renewcommand{\marginfont}{\small\color{PrimeBlue}} - % Title formatting for margin notes. - %\newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}} - % Put a glossary definition in a margin note. % Optional parameter is vertical adjustment of the note. \newcommand{\margindef}[2][0pt]{% \index{\glsentryname{#2}}% Add a reference to this in the index. \textbf{\gls{#2}}% This is the text that appears on the page. \marginnote{% Create the margin note. - %\marginfont \textsf{\textbf{ \Glsentryname{#2}:% Create the title of the margin note. }} @@ -189,18 +180,14 @@ \newcommand{\mnote}[2][0pt]{% \footnotemark \marginnote{ - %\marginfont \footnotemark[\value{footnote}]#2}[#1] } \RequirePackage[hypcap=true]{caption} \newcommand{\marginfig}[2]{% \marginnote{ - %\marginfont - \captionsetup{type=figure} - \begin{center} - \includegraphics{#1} - \end{center} + \captionsetup{type=figure}% + {\centering\includegraphics{#1}\par} \captionof{figure}{#2} } } @@ -237,6 +224,7 @@ } \newcommand{\lblTable}[2][]{ \textbf{\lblGeneral[#1]{#2}{\caption}{tbl}} + \smallskip } \newcommand{\lblFigure}[2][]{ \textbf{\lblGeneral[#1]{#2}{\caption}{fig}}