- Split PrimeManual package into multiple packages.

- Change original PrimeManual package into a class and rename Manual.
This commit is contained in:
Silcantar
2025-07-09 21:01:35 -05:00
parent 40b8836e51
commit 8dfaf66c18
16 changed files with 364 additions and 307 deletions

58
MarginNotes.sty Normal file
View File

@@ -0,0 +1,58 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/MarginNotes}[2025-07-09]
% Margin Note formatting.
%#region
\RequirePackage{marginnote}
\colorlet{marginTextColor}{PrimeBlue}
\renewcommand{\marginfont}{\small\color{marginTextColor}}
% Put a glossary definition in a margin note.
% Optional parameter is vertical adjustment of the note.
\newcommand{\mdef}[3][0pt]{%
\index{\glsentryname{#2}}% Add a reference to this in the index.
\textbf{#3{#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}% Create the text of the margin note.
}[#1]%
}
\newcommand{\margindef}[2][0pt]{%
\mdef[#1]{#2}{\gls}%
}
\newcommand{\Margindef}[2][0pt]{%
\mdef[#1]{#2}{\Gls}%
}
% 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]%
}
\newcommand{\mfig}[5][0pt]{%
% This strut ensures that the margin figure is counted as part of the
% following paragraph and is vertically aligned with it.
\strut%
\marginnote{%
\captionsetup{%
type = figure,%
font = {color=marginTextColor},%
}%
{\centering#5{#2}\par}%
\captionof{figure}{#4}%
\label{fig:#3}%
}[#1]%
}
\newcommand{\marginfig}[4][0pt]{%
\mfig[#1]{#2}{#3}{#4}{\includegraphics}%
}
\newcommand{\marginfigw}[5][0pt]{%
\mfig[#1]{#2}{#3}{#4}{\includegraphics[keepaspectratio,width=#5]}%
}
%#endregion