- Split PrimeManual package into multiple packages.
- Change original PrimeManual package into a class and rename Manual.
This commit is contained in:
58
MarginNotes.sty
Normal file
58
MarginNotes.sty
Normal 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
|
||||
Reference in New Issue
Block a user