From 287c8fde8a334c119297bd1a3cff190e514db68a Mon Sep 17 00:00:00 2001 From: Silcantar Date: Wed, 6 Aug 2025 22:42:05 -0500 Subject: [PATCH] - add italic shape to slab font. - add twinfig macro. - add optional arguments to marginalia macros to be passed to the marginalia command. --- packages/Color.sty | 4 ++-- packages/Fonts.sty | 10 +++++++--- packages/Graphics.sty | 29 ++++++++++++++++++++++++++++- packages/Marginalia.sty | 34 +++++++++++++++++----------------- 4 files changed, 54 insertions(+), 23 deletions(-) diff --git a/packages/Color.sty b/packages/Color.sty index 84e2f8f..363d5a1 100644 --- a/packages/Color.sty +++ b/packages/Color.sty @@ -31,8 +31,8 @@ \definecolor{PrimePaleBlue}{RGB}{233,236,251} } -\definecolor{WarningBoxBGColor}{RGB}{255,255,128} -\definecolor{WarningBoxFGColor}{RGB}{255,192,0} +\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118} +\definecolor{WarningBoxFGColor}{RGB}{255, 192, 0} \newcommand{\boxedcolor}[3][white]{ \fcolorbox{black}{#2}{\textcolor{#1}{#3}} diff --git a/packages/Fonts.sty b/packages/Fonts.sty index 54f6c25..757beae 100644 --- a/packages/Fonts.sty +++ b/packages/Fonts.sty @@ -38,10 +38,14 @@ % Headings & Titles font: Roboto Slab \newfontfamily{\sbfamily}{RobotoSlab}[ - Path = {\fontpath/RobotoSlab/}, + Path = {\fontpath/}, Extension = .ttf, - UprightFont = *-SemiBold, - BoldFont = *-Black, + UprightFont = RobotoSlab/RobotoSlab-SemiBold, + BoldFont = RobotoSlab/RobotoSlab-Black, + % Roboto Slab doesn't have any italic form, so use + % the Roboto Serif version. + ItalicFont = RobotoSerif/RobotoSerif-SemiBoldItalic, + BoldItalicFont = RobotoSerif/RobotoSerif-ExtraBoldItalic, ] \newcommand{\serif}[1]{\textrm{#1}} diff --git a/packages/Graphics.sty b/packages/Graphics.sty index c4023bc..6dce96f 100644 --- a/packages/Graphics.sty +++ b/packages/Graphics.sty @@ -75,9 +75,36 @@ }% } +\newlength{\twinfigwidth} +\setlength{\twinfigwidth}{\textwidth / 2 + \bigfloatoverhang} + +\newcommand{\twinfig}[7][\bigfloatoverhang]{% + \bigfloat[#1]{figure}{htp}{%begin{table}[htp]% + \begin{tabular}{*{2}{p{\twinfigwidth}}}%\begin{tblr}{Q[l,m]Q[l,m]}% + \vfill% + \captionsetup{type=figure}% + \includegraphics[% + keepaspectratio,width=\twinfigwidth% + ]{#2}% + \captionof{figure}{#4}% + \label{fig:#3}% + \vfill% + &% + \vfill% + \captionsetup{type=figure}% + \includegraphics[% + keepaspectratio,width=\twinfigwidth% + ]{#5}% + \captionof{figure}{#7}% + \label{fig:#6}% + \vfill% + \end{tabular}%\end{tblr}% + }%\end{table}% +} + \newcommand{\wrapfig}[6][0in]{% % Syntax: - % \wrapfig[ + % \wrapfig[% % horizontal_offset % ]{ % graphic_file diff --git a/packages/Marginalia.sty b/packages/Marginalia.sty index a25cefe..3493a14 100644 --- a/packages/Marginalia.sty +++ b/packages/Marginalia.sty @@ -19,32 +19,32 @@ } % Put a glossary definition in a margin paragraph. -\newcommand{\mdef}[2]{% - \index{\glsentryname{#1}}% Add a reference to this in the index. - \strong{#2{#1}}% This is the text that appears on the page. - \marginalia{% - \slab{\strong{\Glsentryname{#1}:}} % Create the title of the margin note. - \glsdesc*{#1}% Create the text of the margin note. +\newcommand{\mdef}[3][]{% + \index{\glsentryname{#2}}% Add a reference to this in the index. + \strong{#3{#2}}% This is the text that appears on the page. + \marginalia[#1]{% + \strong{\Glsentryname{#2}:} % Create the title of the margin note. + \glsdesc*{#2}% Create the text of the margin note. }% } -\newcommand{\margindef}[1]{% - \mdef{#1}{\gls}% +\newcommand{\margindef}[2][]{% + \mdef[#1]{#2}{\gls}% } -\newcommand{\Margindef}[1]{% - \mdef{#1}{\Gls}% +\newcommand{\Margindef}[2][]{% + \mdef[#1]{#2}{\Gls}% } -\newcommand{\margindefpl}[1]{% - \mdef{#1}{\glspl}% +\newcommand{\margindefpl}[2][]{% + \mdef[#1]{#2}{\glspl}% } -\newcommand{\Margindefpl}[1]{% - \mdef{#1}{\Glspl}% +\newcommand{\Margindefpl}[2][]{% + \mdef[#1]{#2}{\Glspl}% } % Put a footnote in a margin paragraph. -\newcommand{\mnote}[1]{% +\newcommand{\mnote}[2][]{% \footnotemark% - \marginalia{% - \footnotemark[\value{footnote}]#1% + \marginalia[#1]{% + \footnotemark[\value{footnote}]#2% }% }