- Add VSCode fold regions.
- Add margin footnote macro. - Fix margin note vertical offset.
This commit is contained in:
134
PrimeManual.sty
134
PrimeManual.sty
@@ -1,28 +1,32 @@
|
|||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{latex-templates/PrimeManual}[2025-06-24]
|
\ProvidesPackage{latex-templates/PrimeManual}[2025-06-24]
|
||||||
%
|
|
||||||
% Suppress warning about \showhyphens being changed.
|
% Suppress warning about \showhyphens being changed.
|
||||||
\let\CheckCommand\providecommand
|
\let\CheckCommand\providecommand
|
||||||
|
|
||||||
\RequirePackage{microtype}
|
\RequirePackage{microtype}
|
||||||
|
|
||||||
\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}}
|
% Custom document properties.
|
||||||
\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}}
|
%#region
|
||||||
\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}}
|
\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}}
|
||||||
\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}}
|
\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}}
|
||||||
\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}}
|
\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}}
|
||||||
|
\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}}
|
||||||
|
\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
\newcommand{\sTitle}{\makeatletter{\@title}}
|
% Macros to insert document properties.
|
||||||
\newcommand{\sAuthor}{\makeatletter{\@author}}
|
%#region
|
||||||
\newcommand{\sDate}{\makeatletter{\@date}}
|
\newcommand{\sTitle}{\makeatletter{\@title}}
|
||||||
\newcommand{\sCustomer}{\makeatletter{\@customer}}
|
\newcommand{\sAuthor}{\makeatletter{\@author}}
|
||||||
\newcommand{\sCustomerFull}{\makeatletter{\@customerFull}}
|
\newcommand{\sDate}{\makeatletter{\@date}}
|
||||||
\newcommand{\sProjectNumber}{\makeatletter{\@projectNumber}}
|
\newcommand{\sCustomer}{\makeatletter{\@customer}}
|
||||||
\newcommand{\sProjectDesc}{\makeatletter{\@projectDesc}}
|
\newcommand{\sCustomerFull}{\makeatletter{\@customerFull}}
|
||||||
\newcommand{\sProjectTitle}{\makeatletter{Project \@projectNumber : \@projectDesc}}
|
\newcommand{\sProjectNumber}{\makeatletter{\@projectNumber}}
|
||||||
\newcommand{\sVersion}{\makeatletter{\@version}}
|
\newcommand{\sProjectDesc}{\makeatletter{\@projectDesc}}
|
||||||
|
\newcommand{\sProjectTitle}{\makeatletter{Project \@projectNumber : \@projectDesc}}
|
||||||
%\RequirePackage[mark]{gitinfo2}
|
\newcommand{\sVersion}{\makeatletter{\@version}}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Specify Fonts
|
% Specify Fonts
|
||||||
%#region
|
%#region
|
||||||
@@ -55,27 +59,40 @@
|
|||||||
%#endregion
|
%#endregion
|
||||||
|
|
||||||
% Page Layout
|
% Page Layout
|
||||||
\RequirePackage[pass]{geometry}
|
%#region
|
||||||
|
\RequirePackage[pass]{geometry}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Title & Heading Options
|
% Title & Heading Options
|
||||||
\RequirePackage[sf,raggedright]{titlesec}
|
%#region
|
||||||
|
\RequirePackage[sf,raggedright]{titlesec}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Header & Footer Options
|
% Header & Footer Options
|
||||||
\pagestyle{plain}
|
%#region
|
||||||
|
\pagestyle{plain}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Color import and definition
|
% Color import and definition
|
||||||
\RequirePackage{xcolor}
|
%#region
|
||||||
\definecolor{PrimeBlue}{RGB}{25,45,145}
|
\RequirePackage{xcolor}
|
||||||
|
\definecolor{PrimeBlue}{RGB}{25,45,145}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Use Hyperref to automatically create links in the document
|
% Use Hyperref to automatically create links in the document
|
||||||
\RequirePackage{hyperref}
|
%#region
|
||||||
\hypersetup{colorlinks=true, allcolors=PrimeBlue}
|
\RequirePackage{hyperref}
|
||||||
|
\hypersetup{colorlinks=true, allcolors=PrimeBlue}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Graphics package for including images
|
% Graphics package for including images
|
||||||
\RequirePackage{graphicx}
|
%#region
|
||||||
\RequirePackage{calc}
|
\RequirePackage{graphicx}
|
||||||
|
\RequirePackage{calc}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Define custom title page.
|
% Define custom title page.
|
||||||
|
%#region
|
||||||
\newcommand{\PrimeTitlePage}{
|
\newcommand{\PrimeTitlePage}{
|
||||||
\begin{titlepage}
|
\begin{titlepage}
|
||||||
\begin{sffamily}
|
\begin{sffamily}
|
||||||
@@ -110,41 +127,64 @@
|
|||||||
\end{sffamily}
|
\end{sffamily}
|
||||||
\end{titlepage}
|
\end{titlepage}
|
||||||
}
|
}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Paragraph formatting.
|
% Paragraph formatting.
|
||||||
\setlength{\parindent}{0pt}
|
%#region
|
||||||
\setlength{\parskip}{2ex plus 0.5ex minus 0.5ex}
|
\setlength{\parindent}{0pt}
|
||||||
|
\setlength{\parskip}{2ex plus 0.5ex minus 0.5ex}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Table formatting.
|
% Table formatting.
|
||||||
\renewcommand{\arraystretch}{1.5}
|
%#region
|
||||||
\RequirePackage{csvsimple}
|
\renewcommand{\arraystretch}{1.5}
|
||||||
\RequirePackage{longtable}
|
\RequirePackage{csvsimple}
|
||||||
\RequirePackage{colortbl}
|
\RequirePackage{longtable}
|
||||||
\RequirePackage{booktabs}
|
\RequirePackage{colortbl}
|
||||||
|
\RequirePackage{booktabs}
|
||||||
|
|
||||||
|
\newcommand{\bandedrows}{\rowcolors{2}{white}{gray!10}}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Glossary formatting.
|
% Glossary formatting.
|
||||||
\RequirePackage[nopostdot,toc,sort=standard]{glossaries}
|
%#region
|
||||||
|
\RequirePackage[nopostdot,toc,sort=standard]{glossaries}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Index formatting.
|
% Index formatting.
|
||||||
\RequirePackage{makeidx}
|
%#region
|
||||||
\RequirePackage{xstring}
|
\RequirePackage{makeidx}
|
||||||
\newcommand{\idx}[1]{\StrSubstitute{#1}{!}{ }\index{#1}}
|
\RequirePackage{xstring}
|
||||||
|
\newcommand{\idx}[1]{\StrSubstitute{#1}{!}{ }\index{#1}}
|
||||||
|
%#endregion
|
||||||
|
|
||||||
% Margin Note formatting.
|
% Margin Note formatting.
|
||||||
\RequirePackage{marginnote}
|
%#region
|
||||||
% -38pt seems to be just the right vertical adjustment to align margin notes
|
\RequirePackage{marginnote}
|
||||||
% with the reference in the text.
|
% -38pt seems to be just the right vertical adjustment to align margin notes
|
||||||
\renewcommand{\marginnotevadjust}{-38pt}
|
% with the reference in the text.
|
||||||
\renewcommand{\marginfont}{\small\color{PrimeBlue}}
|
%\renewcommand{\marginnotevadjust}{-38pt}
|
||||||
|
\renewcommand{\marginfont}{\small\color{PrimeBlue}}
|
||||||
|
|
||||||
\newcommand{\margintitle}[1]{\paragraph{\textbf{#1}}}
|
% Title formatting for margin notes.
|
||||||
\newcommand{\margindef}[2][0pt]{%
|
\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.
|
\index{\glsentryname{#2}}% Add a reference to this in the index.
|
||||||
\textbf{\gls{#2}}% This is the text that appears on the page.
|
\textbf{\gls{#2}}% This is the text that appears on the page.
|
||||||
\marginnote{% Create the margin note.
|
\marginnote{% Create the margin note.
|
||||||
\margintitle{\Glsentryname{#2}:% Create the title of the margin note.
|
\textsf{\textbf{
|
||||||
} \glsdesc*{#2}}[#1]% Create the text of the margin note.
|
\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
|
% Cross references
|
||||||
%#region
|
%#region
|
||||||
|
|||||||
Reference in New Issue
Block a user