Files
PrimeTeX/PrimeManual.sty
2025-06-27 13:47:07 -05:00

121 lines
3.2 KiB
TeX

\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
\RequirePackage{fontspec}
% Main font: Roboto Serif
\setmainfont{RobotoSerif}[
Path = ./fonts/RobotoSerif/,
Extension = .ttf,
UprightFont = *-Regular,
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,
]
% Title & Heading Options
\RequirePackage[sf,raggedright]{titlesec}
% Header & Footer Options
\pagestyle{plain}
% Color import and definition
\RequirePackage{color}
\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 graphic to 0.25 in from the left edge of the paper.
\put(-\oddsidemargin-0.75in,0){
\includegraphics{graphics/prime_rule.pdf}
}
% The numbers here are just what looks good.
\put(90,-2){
\includegraphics{graphics/prime_heartbeat.pdf}
}
}
\sAuthor
Revision \gitVtagn %\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}
% Margin Note formatting.
\RequirePackage{marginnote}
\renewcommand{\marginnotevadjust}{-38pt} % Magic Number warning!
\renewcommand{\marginfont}{\small\color{PrimeBlue}}
\newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}}
\newcommand{\margindef}[3][0pt]{\textbf{#2}\marginnote{\margintitle{#2:} #3}[#1]}