- Debugging.

- Move all \RequirePackages to commonincludes.def.
This commit is contained in:
2025-09-12 16:15:29 -05:00
parent 0e68ac723d
commit 029916b8d6
19 changed files with 209 additions and 243 deletions

View File

@@ -1,5 +1,8 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesClass{PrimeTeX/Manual}[2025-08-16] \ProvidesExplClass{PrimeTeX/Manual}{2025-09-12}{1.0}{
A class creating for user manuals and other book-like documents to be
published by Prime Controls.
}
\RequirePackage{ifthen} \RequirePackage{ifthen}
@@ -73,3 +76,15 @@
} }
\NewDocumentCommand{\rem}{+m}{} \NewDocumentCommand{\rem}{+m}{}
\str_new:N \l_IncludeOnly_chapters_str
% Wrapper for \includeonly.
% If argument is empty, all chapters are included.
% If the argument is not empty, only chapters that are listed are included.
\NewDocumentCommand{\IncludeOnlyChapters}{m}{
\str_set:Nn \l_IncludeOnly_chapters_str {#1}
\str_if_empty:NF \l_IncludeOnly_chapters_str {
\expanded{\noexpand\includeonly{\l_IncludeOnly_chapters_str}}
}
}

View File

@@ -1,10 +1,72 @@
\ProvidesFile{commonincludes.def}[2025-09-02 v1.0] \ProvidesFile{commonincludes.def}[2025-09-02 v1.0]
% Load graphicx first because the menukeys package (in Fonts.sty) causes a conflict. \RequirePackage{amssymb}
% Graphics package for including images
\RequirePackage{calc}
\RequirePackage[strict]{changepage}
\RequirePackage{csvsimple-l3}
\RequirePackage[en-US]{datetime2}
% Header & Footer Options
\RequirePackage{fancyhdr}
\RequirePackage{float}
% Specify Fonts
\RequirePackage{fontspec}
% Page Layout
\RequirePackage{geometry}
\RequirePackage[final]{graphicx} \RequirePackage[final]{graphicx}
\RequirePackage{graphbox} \RequirePackage{graphbox}
% Glossary formatting.
\RequirePackage[
xindy,
nopostdot,
toc,
sort=standard,
]{glossaries}
\RequirePackage{hyperref}
%\RequirePackage{hypcap}
\RequirePackage{ifthen}
\RequirePackage{lua-widow-control}
% Index formatting.
\RequirePackage{makeidx}
\RequirePackage{marginalia}
\RequirePackage[os=win]{menukeys}
\RequirePackage{microtype}
% Allow hyphenation in narrow margin paragraphs.
\RequirePackage{ragged2e}
% Table formatting.
\RequirePackage{tabularray}
\RequirePackage[raggedright]{titlesec}
\RequirePackage{readarray}
\RequirePackage{wrapstuff}
% Color import and definition
\RequirePackage{xcolor}
\RequirePackage{xstring}
% A lot of other packages require Layout, so load it first. % A lot of other packages require Layout, so load it first.
\RequirePackage{PrimeTeX/packages/Layout} \RequirePackage{PrimeTeX/packages/Layout}
@@ -20,8 +82,6 @@
\RequirePackage{PrimeTeX/packages/Fonts} \RequirePackage{PrimeTeX/packages/Fonts}
\RequirePackage{PrimeTeX/packages/Glossary}
\RequirePackage{PrimeTeX/packages/Graphics} \RequirePackage{PrimeTeX/packages/Graphics}
\RequirePackage{PrimeTeX/packages/Header} \RequirePackage{PrimeTeX/packages/Header}

View File

@@ -3,11 +3,6 @@
Commands for typesetting boxouts. Commands for typesetting boxouts.
} }
\RequirePackage{PrimeTeX/packages/Layout}
\RequirePackage{PrimeTeX/packages/Color}
\RequirePackage{PrimeTeX/packages/Tables}
\RequirePackage{calc}
\ProvideLength{\boxoutpadding}[1em] \ProvideLength{\boxoutpadding}[1em]
\ProvideLength{\boxoutrule}[1pt] \ProvideLength{\boxoutrule}[1pt]
@@ -32,21 +27,22 @@
\keys_define:nn {Boxout} { \keys_define:nn {Boxout} {
innerspec .tl_set_e:N= \l_Boxout_innerspec_tl, innerspec .tl_set_e:N= \l_Boxout_innerspec_tl,
innerspec .initial:e = {\c_Boxout_innerspec_tl}, innerspec .initial:e = {\c_Boxout_innerspec_tl},
innerspec .default:e = {\c_Boxout_innerspec_tl},
warning .bool_set:N = \l_Boxout_warning_bool, warning .bool_set:N = \l_Boxout_warning_bool,
warning .initial:e = {false}, warning .initial:e = {false},
warning .default:e = {true},
format .cs_set:Np = \__Boxout_format:,
format .initial:n = {\justifying},
} }
\NewDocumentEnvironment{Boxout}{ \NewDocumentEnvironment{Boxout}{
% #1: Key-value options. % #1: Key-value options.
O{} O{}
% #2: Label, passed to @boxout argument #1. % #2: Label.
>{\TrimSpaces}m >{\TrimSpaces}m
% #3: Caption. % #3: Caption.
O{} O{}
% #4: Body, passed to @boxout. % #4: Body.
+b +b
}{ \group_begin: }{ \group_begin:
\keys_set:nn{Boxout}{#1} \keys_set:nn{Boxout}{#1}
@@ -54,17 +50,20 @@
\colorlet{boxoutBG}{warningBG} \colorlet{boxoutBG}{warningBG}
\colorlet{boxoutFG}{warningFG} \colorlet{boxoutFG}{warningFG}
} }
\color{text}
\label{box:#2} \label{box:#2}
\tl_if_empty:nTF {#3} { \tl_if_empty:nTF {#3} {
\expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}} \expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}}
\setlength{\parskip}{\medskipamount} \setlength{\parskip}{\medskipamount}
#4\\ \setlength{\parindent}{0pt}
\__Boxout_format:\ignorespaces#4\\
\end{tblrBoxout} \end{tblrBoxout}
}{ }{
\expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}} \expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}}
\SetCell{halign=c, font={\sbfamily\bfseries}}{#3}\\ \SetCell{halign=c, font={\sbfamily\bfseries}}{#3}\\
\setlength{\parskip}{\medskipamount} \setlength{\parskip}{\medskipamount}
#4\\ \setlength{\parindent}{0pt}
\__Boxout_format:\ignorespaces#4\\
\end{tblrBoxout} \end{tblrBoxout}
} }
\group_end: }{} \group_end: }{}
@@ -140,16 +139,21 @@
\group_end: }{} \group_end: }{}
\dim_const:Nn \c_WrapBoxout_width_dim {3in} \dim_const:Nn \c_WrapBoxout_width_dim {3in}
\dim_const:Nn \c_WrapBoxout_justifywidth_dim {18em}
\keys_define:nn{}{ \keys_define:nn{}{
WrapBoxout .inherit:n = {WrapFig, Boxout}, WrapBoxout .inherit:n = {WrapFig, Boxout},
} }
\keys_define:nn{WrapBoxout}{ \keys_define:nn{WrapBoxout}{
justifywidth.dim_set:N = \l_WrapBoxout_justifywidth_dim,
justifywidth.initial:e = {\c_WrapBoxout_justifywidth_dim},
width .dim_set:N = \l_WrapBoxout_width_dim, width .dim_set:N = \l_WrapBoxout_width_dim,
width .initial:e = {\c_WrapBoxout_width_dim}, width .initial:e = {\c_WrapBoxout_width_dim},
width .default:e = {\c_WrapBoxout_width_dim},
} }
\cs_new:Npn \__WrapBoxout_format: {}
\NewDocumentEnvironment{WrapBoxout}{ \NewDocumentEnvironment{WrapBoxout}{
% #1: Key-value options. % #1: Key-value options.
O{} O{}
@@ -162,6 +166,11 @@
}{ \group_begin: }{ \group_begin:
\keys_set:nn{WrapBoxout}{#1} \keys_set:nn{WrapBoxout}{#1}
\__WrapFig_process_options: \__WrapFig_process_options:
\dim_compare:nNnTF {\l_WrapBoxout_width_dim} > {\l_WrapBoxout_justifywidth_dim} {
\cs_set:Npn \__WrapBoxout_format: {\justifying}
} {
\cs_set:Npn \__WrapBoxout_format: {\l_WrapFig_format_tl}
}
% \message{ % \message{
% WrapBoxout:~ % WrapBoxout:~
% placement:~\l_WrapFig_placement_str,~ % placement:~\l_WrapFig_placement_str,~
@@ -176,6 +185,7 @@
\begin{Boxout}[ \begin{Boxout}[
innerspec:e = {\l_Boxout_innerspec_tl,columns={\dim_use:N \l_WrapBoxout_width_dim}}, innerspec:e = {\l_Boxout_innerspec_tl,columns={\dim_use:N \l_WrapBoxout_width_dim}},
warning:e = \bool_to_str:N \l_Boxout_warning_bool, warning:e = \bool_to_str:N \l_Boxout_warning_bool,
format = {\__WrapBoxout_format:}
]{#2}[#3] ]{#2}[#3]
#4 #4
\end{Boxout} \end{Boxout}

View File

@@ -3,21 +3,6 @@
Custom Caption commands. Custom Caption commands.
} }
% \RequirePackage[
% hypcap=true,
% ]{caption}
% \captionsetup{
% justification = Centering,
% font = {
% small,
% color=caption,
% },
% }
% Define a justification style that is ragged on the side toward the outside of
% the page. I. e. RaggedRight on
%\RequirePackage{changepage}
\NewDocumentCommand{\RaggedOutside}{}{ \NewDocumentCommand{\RaggedOutside}{}{
\ifthenelse{\boolean{isElectronic}}{% \ifthenelse{\boolean{isElectronic}}{%
\RaggedRight% \RaggedRight%
@@ -31,7 +16,7 @@
}% }%
} }
\cs_new:Nn \__MyCaption_format_default: {\centering\small\color{caption}} \cs_new_protected:Nn \__MyCaption_format_default: {\Centering\small\color{caption}}
\keys_define:nn {MyCaption} { \keys_define:nn {MyCaption} {
before .bool_set:N = \l_MyCaption_before_bool, before .bool_set:N = \l_MyCaption_before_bool,
@@ -40,9 +25,10 @@
figure .code:n = {\str_set:Nn \l_MyCaption_type_str {figure}}, figure .code:n = {\str_set:Nn \l_MyCaption_type_str {figure}},
format .cs_set_protected:Np = \__MyCaption_format:, format .cs_set_protected:Np = \__MyCaption_format:,
format .initial:n = {},%{\__MyCaption_format_default:}, format .initial:n = {},
format .default:n = {},
skip .tl_set:N = \l_MyCaption_skip_tl, skip .dim_set:N = \l_MyCaption_skip_dim,
skip .initial:n = {\medskipamount}, skip .initial:n = {\medskipamount},
table .code:n = { table .code:n = {
@@ -66,8 +52,11 @@
>{\TrimSpaces}m >{\TrimSpaces}m
% #3: Caption % #3: Caption
m m
% #4: Body
+b
}{ }{
\group_begin: \group_begin:
\keys_set:nn {MyCaption} {format}
\keys_set:nn {MyCaption} {#1} \keys_set:nn {MyCaption} {#1}
\str_case:en {\l_MyCaption_type_str} { \str_case:en {\l_MyCaption_type_str} {
{figure} { {figure} {
@@ -76,7 +65,9 @@
\str_set:Ne \l_MyCaption_number_str { \str_set:Ne \l_MyCaption_number_str {
\arabic{chapter}.\arabic{figure} \arabic{chapter}.\arabic{figure}
} }
\addcontentsline{lof}{figure}{\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3} \addcontentsline{lof}{figure}{
\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3
}
} }
{table} { {table} {
\refstepcounter{table} \refstepcounter{table}
@@ -84,24 +75,28 @@
\str_set:Ne \l_MyCaption_number_str { \str_set:Ne \l_MyCaption_number_str {
\arabic{chapter}.\arabic{table} \arabic{chapter}.\arabic{table}
} }
\addcontentsline{lot}{table}{\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3} \addcontentsline{lot}{table}{
\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3
} }
} }
\bool_if:NT \l_MyCaption_before_bool {
\__MyCaption_insert_caption:nn {#2} {#3}
} }
}{
\bool_if:NF \l_MyCaption_before_bool { \bool_if:NF \l_MyCaption_before_bool {
\__MyCaption_insert_caption:nn {#2} {#3} \label{#2}
#4
}
\setlength{\parskip}{\l_MyCaption_skip_dim}
\par
\__MyCaption_format_default: \__MyCaption_format:
\l_MyCaption_label_str{}~\l_MyCaption_number_str :~#3
\par
\bool_if:NT \l_MyCaption_before_bool {
\label{#2}
#4
} }
\group_end: \group_end:
} }{}
\cs_new:Nn \__MyCaption_insert_caption:nn { \cs_new:Nn \__MyCaption_insert_caption:n {
\setlength{\parskip}{\l_MyCaption_skip_tl}\par \protect\__MyCaption_format_default: \protect\__MyCaption_format:
\__MyCaption_format_default: \__MyCaption_format: \l_MyCaption_label_str{}~\l_MyCaption_number_str :~#1
\l_MyCaption_label_str{}~\l_MyCaption_number_str :~#2
\label{#1}
\par
} }

View File

@@ -1,11 +1,6 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Color}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/Color}[2025-07-09]
\RequirePackage{ifthen}
% Color import and definition
\RequirePackage{xcolor}
% Split Complementary Color Scheme % Split Complementary Color Scheme
% Primary Color: Blue % Primary Color: Blue
% Secondary Colors: Orange, Teal % Secondary Colors: Orange, Teal

View File

@@ -1,49 +0,0 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/CrossRef}[2025-07-09]
% Cross references
\NewDocumentCommand{\refPart}{O{Part~} m}{#1\ref{pt:#2}}
\NewDocumentCommand{\refChapter}{O{Chapter~} m}{#1\ref{ch:#2}}
\NewDocumentCommand{\refAppendix}{O{Appendix~} m}{#1\ref{ch:#2}}
\NewDocumentCommand{\refSection}{O{Section~} m}{#1\ref{sec:#2}}
\NewDocumentCommand{\refSubsection}{O{Subsection~} m}{#1\ref{subsec:#2}}
\NewDocumentCommand{\refSubsubsection}{O{Sub-subsection~} m}{#1\ref{sssec:#2}}
\NewDocumentCommand{\refParagraph}{O{Paragraph} m}{#1\ref{par:#2}}
\NewDocumentCommand{\refSubparagraph}{O{Subparagraph~} m}{#1\ref{subpar:#2}}
\NewDocumentCommand{\refTable}{O{Table~} m}{#1\ref{tbl:#2}}
\NewDocumentCommand{\refFigure}{O{Figure~} m}{#1\ref{fig:#2}}
\NewDocumentCommand{\lblGeneral}{>{\TrimSpaces}O{} >{\TrimSpaces}m m >{\TrimSpaces}m}{
\if\relax\detokenize{#1}\relax % Check if #1 is empty string.
#3{#2}\label{#4:#2}
\else
#3{#2}\label{#4:#1}
\fi
}
\NewDocumentCommand{\lblPart}{O{} m}{
\lblGeneral[#1]{#2}{\part}{pt}
}
\NewDocumentCommand{\lblChapter}{O{} m}{
\lblGeneral[#1]{#2}{\chapter}{ch}
}
\NewDocumentCommand{\lblSection}{O{} m}{
\lblGeneral[#1]{#2}{\section}{sec}
}
\NewDocumentCommand{\lblSubsection}{O{} m}{
\lblGeneral[#1]{#2}{\subsection}{subsec}
}
\NewDocumentCommand{\lblSubsubsection}{O{} m}{
\lblGeneral[#1]{#2}{\subsubsection}{sssec}
}
\NewDocumentCommand{\lblParagraph}{O{} m}{
\lblGeneral[#1]{#2}{\paragraph}{par}
}
\NewDocumentCommand{\lblSubparagraph}{O{} m}{
\lblGeneral[#1]{#2}{\subparagraph}{subpar}
}
\NewDocumentCommand{\lblTable}{O{} m}{
\lblGeneral[#1]{#2}{\caption}{tbl}
}
\NewDocumentCommand{\lblFigure}{O{} m}{
\lblGeneral[#1]{#2}{\caption}{fig}
}

View File

@@ -1,8 +1,6 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09]
\RequirePackage[en-US]{datetime2}
\DTMnewdatestyle{longdate}{% \DTMnewdatestyle{longdate}{%
\renewcommand{\DTMdisplaydate}[4]{\number##3\ \DTMenglishmonthname{##2}\ \number##1}% \renewcommand{\DTMdisplaydate}[4]{\number##3\ \DTMenglishmonthname{##2}\ \number##1}%
\renewcommand{\DTMDisplaydate}{\DTMdisplaydate}% \renewcommand{\DTMDisplaydate}{\DTMdisplaydate}%
@@ -14,7 +12,6 @@
\DTMusedate{saveDate} \DTMusedate{saveDate}
} }
\RequirePackage{readarray}
\readarraysepchar{,} \readarraysepchar{,}
\NewDocumentCommand{\GetRevision}{m}{% \NewDocumentCommand{\GetRevision}{m}{%

View File

@@ -4,10 +4,6 @@
Custom Float Environments. Custom Float Environments.
} }
\RequirePackage{PrimeTeX/packages/Layout}
\RequirePackage{float}
\floatstyle{plain} \floatstyle{plain}
\newfloat{generic}{htpb}{lgf} \newfloat{generic}{htpb}{lgf}
\floatplacement{figure}{htpb} \floatplacement{figure}{htpb}
@@ -119,25 +115,25 @@
} }
\NewDocumentCommand{\CenterFig}{ \NewDocumentCommand{\CenterFig}{
% Key-value options passed to \includegraphics.
O{}
% Key-value options. % Key-value options.
O{} O{}
% Graphic file. % Graphic file.
m m
% Key-value options passed to \includegraphics.
O{}
% Label. % Label.
>{\TrimSpaces}m >{\TrimSpaces}m
% Caption. % Caption.
m m
}{ \group_begin: }{ \group_begin:
\keys_set:nn{CenterFig}{#2} \keys_set:nn{CenterFig}{#1}
\clist_use_default:Nnnn \l_CenterFig_placement_str \clist_use_default:Nnnn \l_CenterFig_placement_str
{\l_Float_placement_clist} {\l_Float_placement_clist}
{\c_Float_placement_clist} {\c_Float_placement_clist}
\expanded{\noexpand\begin{figure}[\l_CenterFig_placement_str]} \expanded{\noexpand\begin{figure}[\l_CenterFig_placement_str]}
\begin{MyCaption}{fig:#4}{#5} \begin{MyCaption}{fig:#4}{#5}
\Centering \Centering
\includegraphics[keepaspectratio,#1]{#3} \includegraphics[keepaspectratio,#3]{#2}
\end{MyCaption} \end{MyCaption}
\end{figure} \end{figure}
\group_end: } \group_end: }

View File

@@ -1,9 +1,6 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Fonts}[2025-06-24] \ProvidesPackage{PrimeTeX/packages/Fonts}[2025-06-24]
% Specify Fonts
\RequirePackage{fontspec}
\NewDocumentCommand{\fontpath}{}{PrimeTeX/fonts} \NewDocumentCommand{\fontpath}{}{PrimeTeX/fonts}
% Main font: Roboto Serif % Main font: Roboto Serif
@@ -57,8 +54,6 @@
ItalicFont = NotoEmoji/NotoEmoji-Light, ItalicFont = NotoEmoji/NotoEmoji-Light,
] ]
\RequirePackage{amssymb}
\NewDocumentCommand{\serif}{m}{\textrm{#1}} \NewDocumentCommand{\serif}{m}{\textrm{#1}}
\NewDocumentCommand{\sans}{m}{\textsf{#1}} \NewDocumentCommand{\sans}{m}{\textsf{#1}}
\NewDocumentCommand{\mono}{m}{\texttt{#1}} \NewDocumentCommand{\mono}{m}{\texttt{#1}}
@@ -66,8 +61,6 @@
\NewDocumentCommand{\code}{m}{\mono{\small{}#1}} \NewDocumentCommand{\code}{m}{\mono{\small{}#1}}
\NewDocumentCommand{\emoji}{m}{{\emfamily{}#1}} \NewDocumentCommand{\emoji}{m}{{\emfamily{}#1}}
\RequirePackage[os=win]{menukeys}
\renewmenumacro{\directory}[/]{hyphenatepaths} \renewmenumacro{\directory}[/]{hyphenatepaths}
\renewmenumacro{\keys}[+]{shadowedangularkeys} \renewmenumacro{\keys}[+]{shadowedangularkeys}
\renewmenumacro{\menu}[>]{angularmenus} \renewmenumacro{\menu}[>]{angularmenus}

View File

@@ -1,10 +0,0 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Glossary}[2025-07-09]
% Glossary formatting.
\RequirePackage[
xindy,
nopostdot,
toc,
sort=standard,
]{glossaries}

View File

@@ -3,12 +3,6 @@
Custom non-floating Graphics commands. Custom non-floating Graphics commands.
} }
\RequirePackage{PrimeTeX/packages/Layout}
\RequirePackage{calc}
\RequirePackage{wrapstuff}
\dim_const:Nn \c_Graphics_icon_dim {0.25in} \dim_const:Nn \c_Graphics_icon_dim {0.25in}
\NewDocumentCommand{\IconSize}{}{\c_Graphics_icon_dim} \NewDocumentCommand{\IconSize}{}{\c_Graphics_icon_dim}
@@ -16,11 +10,9 @@
\keys_define:nn{InlineGraphic}{ \keys_define:nn{InlineGraphic}{
height .dim_set:N = \l_InlineGraphic_height_dim, height .dim_set:N = \l_InlineGraphic_height_dim,
height .initial:n = {12pt}, height .initial:n = {12pt},
% height .default:n = {12pt},
offset .dim_set:N = \l_InlineGraphic_offset_dim, offset .dim_set:N = \l_InlineGraphic_offset_dim,
offset .initial:n = {-2pt}, offset .initial:n = {-2pt},
% offset .default:n = {-2pt},
} }
\NewDocumentCommand{\InlineGraphic}{ \NewDocumentCommand{\InlineGraphic}{
@@ -28,20 +20,20 @@
O{} O{}
% Graphic file. % Graphic file.
m m
}{% }{
\keys_set:nn{InlineGraphic}{#1} \keys_set:nn{InlineGraphic}{#1}
\raisebox{\l_InlineGraphic_offset_dim}{ \raisebox{\l_InlineGraphic_offset_dim}{
\includegraphics[% \includegraphics[
keepaspectratio,height=12pt%\l_InlineGraphic_height_dim% keepaspectratio,height=12pt
]{#2} ]{#2}
}% }
} }
\dim_const:Nn \c_ig_width_dim {0.5in} \dim_const:Nn \c_ig_width_dim {0.5in}
% Shorthand command for \includegraphics. % Shorthand command for \includegraphics.
\NewDocumentCommand{\ig}{O{width=\c_ig_width_dim} m}{% \NewDocumentCommand{\ig}{O{width=\c_ig_width_dim} m}{
\includegraphics[keepaspectratio,#1]{#2}% \includegraphics[keepaspectratio,#1]{#2}
} }
\dim_const:Nn \c_WrapFig_hoffset_dim {0in} \dim_const:Nn \c_WrapFig_hoffset_dim {0in}
@@ -95,7 +87,8 @@
WrapFig:~#4,~ WrapFig:~#4,~
placement:~\l_WrapFig_placement_str,~ placement:~\l_WrapFig_placement_str,~
hoffset:~\dim_use:N \l_WrapFig_hoffset_dim, hoffset:~\dim_use:N \l_WrapFig_hoffset_dim,
passed_keys:~\l_WrapFig_passed_keys_str} passed_keys:~\l_WrapFig_passed_keys_str
}
\expanded{\noexpand\begin{wrapstuff}[ \expanded{\noexpand\begin{wrapstuff}[
\l_WrapFig_placement_str, \l_WrapFig_placement_str,
hoffset = {\dim_use:N \l_WrapFig_hoffset_dim}, hoffset = {\dim_use:N \l_WrapFig_hoffset_dim},

View File

@@ -3,20 +3,9 @@
Customize header and footer layout and contents. Customize header and footer layout and contents.
} }
\RequirePackage{PrimeTeX/packages/Layout} \ProvideLength{\HeaderInsideOffset}[\BigFloatOverhang]
\ProvideLength{\HeaderOutsideOffset}[\fp_to_dim:n{\BigFloatOverhang * \BigFloatOffset}]
% \dim_new:N \g_header_insideoffset_dim
% \dim_set:Nn \g_header_insideoffset_dim {\c_BigFloat_overhang_dim}
% \dim_new:N \g_header_outsideoffset_dim
% \dim_set:Nn \g_header_outsideoffset_dim {
% \fp_to_dim:n {\c_BigFloat_overhang_dim * \c_BigFloat_offset_fp}
% }
\ProvideLength{\HeaderInsideOffset}[0.54in]%[\BigFloatOverhang]
\ProvideLength{\HeaderOutsideOffset}[1.08in]%[\BigFloatOverhang * \real{\BigFloatOffset}]
% Header & Footer Options
\RequirePackage{fancyhdr}
\pagestyle{fancy} \pagestyle{fancy}
% Clear all header & footer formatting. % Clear all header & footer formatting.

View File

@@ -1,7 +1,4 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Index}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/Index}[2025-07-09]
% Index formatting.
\RequirePackage{makeidx}
\RequirePackage{xstring}
\NewDocumentCommand{\idx}{m}{\StrSubstitute{#1}{!}{ }\index{#1}} \NewDocumentCommand{\idx}{m}{\StrSubstitute{#1}{!}{ }\index{#1}}

View File

@@ -12,22 +12,6 @@
\setlength{#1}{#2}% \setlength{#1}{#2}%
} }
\RequirePackage{microtype}
% Page Layout
\RequirePackage[
letterpaper,
width = 4.75in, % 342pt,
height = 8.0in, % 576pt,
left = 1.5in, % 108pt,
top = 1.5in, % 108pt,
head = 12pt, % 1/6in
headsep = 24pt, % 1/3in
marginparwidth = 1.75in, % 126pt,
marginparsep = 12pt, % 1/6in
footskip = 0.5in, % 36pt,
]{geometry}
% Redefine the commands geometry uses to draw the page frame to customize the % Redefine the commands geometry uses to draw the page frame to customize the
% color. % color.
\renewcommand{\Gm@vrule}{\color{layout}\vrule width 0.2pt height\textheight depth\z@} \renewcommand{\Gm@vrule}{\color{layout}\vrule width 0.2pt height\textheight depth\z@}
@@ -37,8 +21,6 @@
% Suppress "Underfull \hbox" infos. % Suppress "Underfull \hbox" infos.
\hbadness=10000 \hbadness=10000
\RequirePackage{ifthen}
\ifthenelse{\boolean{isDraft}}{ \ifthenelse{\boolean{isDraft}}{
\geometry{showframe} \geometry{showframe}
\hfuzz = 0.5pt \hfuzz = 0.5pt
@@ -49,19 +31,27 @@
\vfuzz = 8.0pt \vfuzz = 8.0pt
} }
\geometry{
letterpaper,
width = 4.75in, % 342pt,
height = 8.0in, % 576pt,
left = 1.5in, % 108pt,
top = 1.5in, % 108pt,
head = 12pt, % 1/6in
headsep = 24pt, % 1/3in
marginparwidth = 1.75in, % 126pt,
marginparsep = 12pt, % 1/6in
footskip = 0.5in, % 36pt,
}
\ifthenelse{\boolean{isElectronic}}{ \ifthenelse{\boolean{isElectronic}}{
% \geometry{} % \geometry{}
}{ }{
\geometry{twoside} \geometry{twoside}
} }
\RequirePackage{calc} % Lua-Widow-Control Setup.
\RequirePackage[strict]{changepage} \lwcsetup{
\ProvideLength{\marparwidth}[\marginparsep + \marginparwidth]
\ProvideLength{\contentwidth}[\textwidth + \marparwidth]
\RequirePackage[
%debug, %debug,
balanced, balanced,
emergencystretch = 3em, emergencystretch = 3em,
@@ -70,7 +60,10 @@
orphanpenalty = 1000, orphanpenalty = 1000,
brokenpenalty = 10000, brokenpenalty = 10000,
nobreak = keep, nobreak = keep,
]{lua-widow-control} }
\ProvideLength{\marparwidth}[\marginparsep + \marginparwidth]
\ProvideLength{\contentwidth}[\textwidth + \marparwidth]
\ifthenelse{\boolean{isDraft}}{ \ifthenelse{\boolean{isDraft}}{
\lwcsetup{showcolours=true,} \lwcsetup{showcolours=true,}

View File

@@ -1,10 +1,8 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Links}[2025-08-17] \ProvidesPackage{PrimeTeX/packages/Links}[2025-08-17]
\RequirePackage{PrimeTeX/packages/Color}
% Use Hyperref to automatically create links in the document % Use Hyperref to automatically create links in the document
\RequirePackage[ \hypersetup{
final, final,
colorlinks = true, colorlinks = true,
pdfpagemode = UseOutlines, pdfpagemode = UseOutlines,
@@ -12,7 +10,7 @@
bookmarksnumbered = true, bookmarksnumbered = true,
bookmarksopen = true, bookmarksopen = true,
bookmarksopenlevel = 2, bookmarksopenlevel = 2,
]{hyperref} }
\ifthenelse{\boolean{isElectronic}}{ \ifthenelse{\boolean{isElectronic}}{
\hypersetup{ \hypersetup{
@@ -31,5 +29,3 @@
\RenewDocumentCommand{\subsectionautorefname}{}{Subsection} \RenewDocumentCommand{\subsectionautorefname}{}{Subsection}
\RenewDocumentCommand{\subsubsectionautorefname}{}{Sub-subsection} \RenewDocumentCommand{\subsubsectionautorefname}{}{Sub-subsection}
\RenewDocumentCommand{\paragraphautorefname}{}{Paragraph} \RenewDocumentCommand{\paragraphautorefname}{}{Paragraph}
\RequirePackage{hypcap}

View File

@@ -1,13 +1,13 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Marginalia}[2025-07-09] \ProvidesExplPackage{PrimeTeX/packages/Marginalia}{2025-09-12}{1.0}{
Marginalia commands.
}
% Allow hyphenation in narrow margin paragraphs.
\RequirePackage{ragged2e}
\RequirePackage{marginalia}
\marginaliasetup{ \marginaliasetup{
width = {\marginparwidth},
xsep = {\marginparsep},
ysep = {\parskip}, ysep = {\parskip},
ysep page bottom = { ysep~page~bottom = {
- 1in % Top gutter - 1in % Top gutter
+ \paperheight + \paperheight
- \voffset - \voffset
@@ -17,8 +17,8 @@
- \textheight - \textheight
}, },
yshift = {7pt}, % Just a magic number that lines up margin notes with their reference. yshift = {7pt}, % Just a magic number that lines up margin notes with their reference.
style recto outer = {\RaggedRight\small\color{marginText}}, style~recto~outer = {\RaggedRight\small\color{marginText}},
style verso outer = {\RaggedLeft\small\color{marginText}}, style~verso~outer = {\RaggedLeft\small\color{marginText}},
} }
\NewDocumentCommand{\MarginHyperSetup}{}{ \NewDocumentCommand{\MarginHyperSetup}{}{
@@ -30,30 +30,30 @@
} }
% Put a glossary definition in a margin paragraph. % Put a glossary definition in a margin paragraph.
\NewDocumentCommand{\mdef}{O{} m m}{% \NewDocumentCommand{\@MarginDef}{O{} m m}{%
\index{\glsentryname{#2}}% Add a reference to this in the index. \index{\glsentryname{#2}}% Add a reference to this in the index.
\strong{#3{#2}}% This is the text that appears on the page. \strong{#3{#2}}% This is the text that appears on the page.
\marginalia[#1]{% \marginalia[#1]{%
\MarginHyperSetup% \MarginHyperSetup%
\strong{\Glsentryname{#2}:}% Create the title of the margin note. \strong{\Glsentryname{#2}:}% Create the title of the margin note.
\glsdesc*{#2}% Create the text of the margin note. \enspace\glsdesc*{#2}% Create the text of the margin note.
}% }%
} }
\NewDocumentCommand{\margindef}{O{} m}{% \NewDocumentCommand{\MarginDef}{O{} m}{%
\mdef[#1]{#2}{\gls}% \@MarginDef[#1]{#2}{\gls}%
} }
\NewDocumentCommand{\Margindef}{O{} m}{% \NewDocumentCommand{\MarginDefCap}{O{} m}{%
\mdef[#1]{#2}{\Gls}% \@MarginDef[#1]{#2}{\Gls}%
} }
\NewDocumentCommand{\margindefpl}{O{} m}{% \NewDocumentCommand{\MarginDefPl}{O{} m}{%
\mdef[#1]{#2}{\glspl}% \@MarginDef[#1]{#2}{\glspl}%
} }
\NewDocumentCommand{\Margindefpl}{O{} m}{% \NewDocumentCommand{\MarginDefCapPl}{O{} m}{%
\mdef[#1]{#2}{\Glspl}% \@MarginDef[#1]{#2}{\Glspl}%
} }
% Put a footnote in a margin paragraph. % Put a footnote in a margin paragraph.
\NewDocumentCommand{\mnote}{O{} +m}{% \NewDocumentCommand{\MarginNote}{O{} +m}{%
\footnotemark% \footnotemark%
\marginalia[#1]{% \marginalia[#1]{%
\MarginHyperSetup% \MarginHyperSetup%
@@ -61,7 +61,7 @@
}% }%
} }
\NewDocumentCommand{\marginfig}{ \NewDocumentCommand{\MarginFig}{
% #1: Options passed to \includegraphics. % #1: Options passed to \includegraphics.
O{} O{}
% #2: Graphic file name. % #2: Graphic file name.
@@ -69,16 +69,18 @@
% #3: Label. % #3: Label.
>{\TrimSpaces}m >{\TrimSpaces}m
+m +m
}{% }{
% This strut ensures that the margin figure is counted as part of the % This strut ensures that the margin figure is counted as part of the
% following paragraph and is vertically aligned with it. % following paragraph and is vertically aligned with it.
\strut% %\strut {\setlength{\parskip}{0pt} \par} \strut
\marginalia{% \mbox{
\MarginHyperSetup% \marginalia{
\MarginHyperSetup
\begin{MyCaption}[ \begin{MyCaption}[
format={\RaggedOutside\small\color{caption}} format={\RaggedOutside\small\color{caption}}
]{fig:#3}{#4} ]{fig:#3}{#4}
\Centering\includegraphics[keepaspectratio,#1]{#2}% \Centering\includegraphics[keepaspectratio,#1]{#2}
\end{MyCaption} \end{MyCaption}
}% }
}
} }

View File

@@ -1,8 +1,10 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Tables}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/Tables}[2025-07-09]
% Table formatting. \RenewDocumentCommand\TblrAlignBoth{}{\justifying}
\RequirePackage{tabularray} \RenewDocumentCommand\TblrAlignLeft{}{\RaggedRight}
\RenewDocumentCommand\TblrAlignCenter{}{\Centering}
\RenewDocumentCommand\TblrAlignRight{}{\RaggedLeft}
\UseTblrLibrary{siunitx} \UseTblrLibrary{siunitx}
@@ -13,8 +15,6 @@
hline{2} = {0.4pt}, hline{2} = {0.4pt},
} }
%\renewcommand{\TblrOverlap}[1]{#1}
\DeclareTblrTemplate{remark-tag}{default}{ \DeclareTblrTemplate{remark-tag}{default}{
\strong{\InsertTblrRemarkTag} \strong{\InsertTblrRemarkTag}
} }
@@ -35,5 +35,3 @@
font = \bfseries, font = \bfseries,
} }
} }
\RequirePackage{csvsimple-l3}

View File

@@ -1,8 +1,6 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/TitlePage}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/TitlePage}[2025-07-09]
\RequirePackage{graphicx}
% Define custom title page. % Define custom title page.
\NewDocumentCommand{\PrimeTitlePage}{O{}}{ \NewDocumentCommand{\PrimeTitlePage}{O{}}{
\thispagestyle{empty} \thispagestyle{empty}

View File

@@ -1,8 +1,6 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Titles}[2025-07-16] \ProvidesPackage{PrimeTeX/packages/Titles}[2025-07-16]
\RequirePackage[raggedright]{titlesec}
\ifthenelse{\NOT\boolean{doRomanNumerals}}{ \ifthenelse{\NOT\boolean{doRomanNumerals}}{
\renewcommand{\thepart}{\arabic{part}} \renewcommand{\thepart}{\arabic{part}}
}{} }{}