- Make all packages Expl3.
- Replace ifthen dependency with wrappers for Latex3 conditionals. - Debug CrossRef and WrapBoxout.
This commit is contained in:
74
Manual.cls
74
Manual.cls
@@ -4,77 +4,87 @@
|
||||
published by Prime Controls.
|
||||
}
|
||||
|
||||
\RequirePackage{ifthen}
|
||||
|
||||
% Option 'electronic': single side printing.
|
||||
\newboolean{isElectronic}
|
||||
\setboolean{isElectronic}{false}
|
||||
\bool_new:N \g_electronic_bool
|
||||
\bool_gset_false:N \g_electronic_bool
|
||||
|
||||
\DeclareOption{electronic}{
|
||||
\setboolean{isElectronic}{true}
|
||||
\bool_gset_true:N \g_electronic_bool
|
||||
}
|
||||
|
||||
\NewExpandableDocumentCommand{\IsElectronic}{}{\g_electronic_bool}
|
||||
|
||||
% Option 'admin': turn on admin manual sections.
|
||||
\newboolean{isAdminManual}
|
||||
\setboolean{isAdminManual}{false}
|
||||
\bool_new:N \g_admin_bool
|
||||
\bool_gset_false:N \g_admin_bool
|
||||
|
||||
\DeclareOption{admin}{
|
||||
\setboolean{isAdminManual}{true}
|
||||
\bool_gset_true:N \g_admin_bool
|
||||
}
|
||||
|
||||
\NewExpandableDocumentCommand{\IsAdminManual}{}{\g_admin_bool}
|
||||
|
||||
% Option 'darkmode': render as light text on dark background.
|
||||
\newboolean{isDarkMode}
|
||||
\setboolean{isDarkMode}{false}
|
||||
\bool_new:N \g_dark_mode_bool
|
||||
\bool_gset_false:N \g_dark_mode_bool
|
||||
|
||||
\DeclareOption{darkmode}{
|
||||
\setboolean{isDarkMode}{true}
|
||||
\bool_gset_true:N \g_dark_mode_bool
|
||||
}
|
||||
|
||||
\NewExpandableDocumentCommand{\IsDarkMode}{}{\g_dark_mode_bool}
|
||||
|
||||
% Option 'draft': same as base book class, but with bigger overfull boxes.
|
||||
\newboolean{isDraft}
|
||||
\setboolean{isDraft}{false}
|
||||
\bool_new:N \g_draft_bool
|
||||
\bool_gset_false:N \g_draft_bool
|
||||
|
||||
\DeclareOption{draft}{
|
||||
\setboolean{isDraft}{true}
|
||||
\bool_gset_true:N \g_draft_bool
|
||||
\overfullrule = 1in
|
||||
}
|
||||
|
||||
% Option 'admin': turn on admin manual sections.
|
||||
\newboolean{doRomanNumerals}
|
||||
\setboolean{doRomanNumerals}{false}
|
||||
\NewExpandableDocumentCommand{\IsDraft}{}{\g_draft_bool}
|
||||
|
||||
% Option 'roman': render Part numbers as Roman numerals.
|
||||
\bool_new:N \g_roman_bool
|
||||
\bool_gset_false:N \g_roman_bool
|
||||
|
||||
\DeclareOption{roman}{
|
||||
\setboolean{doRomanNumerals}{true}
|
||||
\bool_gset_true:N \g_roman_bool
|
||||
}
|
||||
|
||||
\NewExpandableDocumentCommand{\DoRomanNumerals}{}{\g_roman_bool}
|
||||
|
||||
% Option 'labels': show Part and Chapter labels in the header.
|
||||
\bool_new:N \g_label_bool
|
||||
\bool_gset_false:N \g_label_bool
|
||||
|
||||
\DeclareOption{labels}{
|
||||
\bool_gset_true:N \g_label_bool
|
||||
}
|
||||
|
||||
\NewExpandableDocumentCommand{\ShowLabels}{}{\g_label_bool}
|
||||
|
||||
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
|
||||
|
||||
\ProcessOptions\relax
|
||||
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\ifthenelse{\boolean{isDraft}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\bool_if:NTF \g_draft_bool {
|
||||
\LoadClass[draft,oneside]{book}
|
||||
}{
|
||||
} {
|
||||
\LoadClass[oneside]{book}
|
||||
}
|
||||
}{
|
||||
\ifthenelse{\boolean{isDraft}}{
|
||||
} {
|
||||
\bool_if:NTF \g_draft_bool {
|
||||
\LoadClass[draft]{book}
|
||||
}{
|
||||
} {
|
||||
\LoadClass{book}
|
||||
}
|
||||
}
|
||||
|
||||
\input{PrimeTeX/commonincludes.def}
|
||||
|
||||
\NewDocumentCommand{\IfAdminManual}{+m +m}{
|
||||
\ifthenelse{\boolean{isAdminManual}}{#1}{#2}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\IfElectronic}{+m +m}{
|
||||
\ifthenelse{\boolean{isElectronic}}{#1}{#2}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\rem}{+m}{}
|
||||
|
||||
\str_new:N \l_IncludeOnly_chapters_str
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
\RequirePackage{ifthen}
|
||||
|
||||
\newboolean{isDarkMode}
|
||||
\setboolean{isDarkMode}{false}
|
||||
\bool_new:N \isDarkMode
|
||||
\bool_set_false:N \isDarkMode
|
||||
|
||||
\DeclareOption{darkmode}{
|
||||
\setboolean{isDarkMode}{true}
|
||||
\bool_set_true:N \isDarkMode
|
||||
}
|
||||
|
||||
\DeclareOption{showoverfull}{
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
\RequirePackage{hyperref}
|
||||
|
||||
\RequirePackage{ifthen}
|
||||
%\RequirePackage{ifthen}
|
||||
|
||||
\RequirePackage{lua-widow-control}
|
||||
|
||||
@@ -68,6 +68,8 @@
|
||||
|
||||
\RequirePackage{PrimeTeX/packages/Boxout}
|
||||
|
||||
\RequirePackage{PrimeTeX/packages/Branch}
|
||||
|
||||
\RequirePackage{PrimeTeX/packages/Caption}
|
||||
|
||||
\RequirePackage{PrimeTeX/packages/Color}
|
||||
|
||||
@@ -53,12 +53,14 @@
|
||||
\color{textColor}
|
||||
\label{box:#2}
|
||||
\tl_if_empty:nTF {#3} {
|
||||
% No header
|
||||
\expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}}
|
||||
\setlength{\parskip}{\medskipamount}
|
||||
\setlength{\parindent}{0pt}
|
||||
\__Boxout_format:\ignorespaces#4\\
|
||||
\end{tblrBoxout}
|
||||
}{
|
||||
% Yes header
|
||||
\expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}}
|
||||
\SetCell{halign=c, font={\sbfamily\bfseries}}{#3}\\
|
||||
\setlength{\parskip}{\medskipamount}
|
||||
@@ -167,9 +169,9 @@
|
||||
\keys_set:nn{WrapBoxout}{#1}
|
||||
\__WrapFig_process_options:
|
||||
\dim_compare:nNnTF {\l_WrapBoxout_width_dim} > {\l_WrapBoxout_justifywidth_dim} {
|
||||
\cs_set:Npn \__WrapBoxout_format: {\justifying}
|
||||
\cs_set:Nn \__WrapBoxout_format: {\justifying}
|
||||
} {
|
||||
\cs_set:Npn \__WrapBoxout_format: {\l_WrapFig_format_tl}
|
||||
\cs_set:Nn \__WrapBoxout_format: {\l_WrapFig_format_tl}
|
||||
}
|
||||
% \message{
|
||||
% WrapBoxout:~
|
||||
@@ -181,14 +183,15 @@
|
||||
hoffset = {\dim_use:N \l_WrapFig_hoffset_dim},
|
||||
\l_WrapFig_passed_keys_str,
|
||||
]}
|
||||
%\begin{minipage}{\l_WrapBoxout_width_dim}
|
||||
\begin{Boxout}[
|
||||
innerspec:e = {\l_Boxout_innerspec_tl,columns={\dim_use:N \l_WrapBoxout_width_dim}},
|
||||
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
|
||||
format = {\__WrapBoxout_format:}
|
||||
innerspec:e = {
|
||||
\l_Boxout_innerspec_tl,
|
||||
columns={\dim_use:N \l_WrapBoxout_width_dim}
|
||||
},
|
||||
warning:e = {\bool_to_str:N \l_Boxout_warning_bool},
|
||||
format = \__WrapBoxout_format:,
|
||||
]{#2}[#3]
|
||||
#4
|
||||
\end{Boxout}
|
||||
%\end{minipage}
|
||||
\end{wrapstuff}
|
||||
\group_end: }{}
|
||||
20
packages/Branch.sty
Normal file
20
packages/Branch.sty
Normal file
@@ -0,0 +1,20 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Branch}{2025-09-18}{1.0}{
|
||||
LaTeX2e-syntax wrappers for LaTeX3 branch commands.
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\If}{m +m +O{}}{
|
||||
\bool_if:nTF {#1} {#2} {#3}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Compare}{o m o}{
|
||||
\bool_if:nTF {\tl_if_novalue_p:n {#1} || \tl_if_novalue_p:n {#3}} {
|
||||
\dim_compare_p:n {#2}
|
||||
} {
|
||||
\dim_compare_p:nNn {#1} #2 {#3}
|
||||
}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Switch}{m +m +O{} +O{}}{
|
||||
\int_case:nnTF {#1} {#2} {#3} {#4}
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\RaggedOutside}{}{
|
||||
\ifthenelse{\boolean{isElectronic}}{%
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\RaggedRight%
|
||||
}{%
|
||||
} {%
|
||||
\checkoddpage%
|
||||
\ifoddpage%
|
||||
\RaggedRight%
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/Color}[2025-07-09]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Color}{2025-09-18}{1.0}{
|
||||
Color definitions.
|
||||
}
|
||||
|
||||
% Split Complementary Color Scheme
|
||||
% Primary Color: Blue
|
||||
@@ -120,7 +122,7 @@
|
||||
Orange, fbefe9 % #fbefe9
|
||||
}
|
||||
|
||||
\ifthenelse{\boolean{isDarkMode}\AND\boolean{isElectronic}}{
|
||||
\bool_if:nTF {\g_dark_mode_bool && \g_electronic_bool} {
|
||||
% Page and text colors.
|
||||
\colorlet{pageColor}{PrimeDarkGray}
|
||||
\colorlet{textColor}{PrimePastelGray}
|
||||
@@ -144,7 +146,7 @@
|
||||
|
||||
% Layout preview frame color.
|
||||
\colorlet{layoutColor}{PrimeGray}
|
||||
}{
|
||||
} {
|
||||
% Page and text colors.
|
||||
\colorlet{pageColor}{white}
|
||||
\colorlet{textColor}{black}
|
||||
|
||||
@@ -2,19 +2,22 @@
|
||||
\ProvidesExplPackage{PrimeTeX/packages/CrossRef}{2025-09-16}{1.0}{
|
||||
Custom label and reference commands.
|
||||
}
|
||||
%<@@=CrossRef>
|
||||
|
||||
\prop_const_from_keyval:Nn \c_section_names_prop {
|
||||
0 = Part\nobreakspace,
|
||||
1 = Chapter\nobreakspace,
|
||||
2 = Section\nobreakspace,
|
||||
3 = Subsection\nobreakspace,
|
||||
4 = Sub-subsection\nobreakspace,
|
||||
5 = Paragraph\nobreakspace,
|
||||
6 = Subparagraph\nobreakspace,
|
||||
9 = Appendix\nobreakspace,
|
||||
\debug_on:n {all}
|
||||
|
||||
\prop_const_from_keyval:Nn \c_@@_section_names_prop {
|
||||
1 = Part\nobreakspace,
|
||||
2 = Chapter\nobreakspace,
|
||||
3 = Section\nobreakspace,
|
||||
4 = Subsection\nobreakspace,
|
||||
5 = Sub-subsection\nobreakspace,
|
||||
6 = Paragraph\nobreakspace,
|
||||
7 = Subparagraph\nobreakspace,
|
||||
8 = Appendix\nobreakspace,
|
||||
}
|
||||
|
||||
\prop_const_from_keyval:Nn \c_section_levels_prop {
|
||||
\prop_const_from_keyval:Nn \c_@@_section_levels_prop {
|
||||
part = 0,
|
||||
chapter = 1,
|
||||
section = 2,
|
||||
@@ -24,162 +27,196 @@
|
||||
subparagraph = 6,
|
||||
}
|
||||
|
||||
\str_const:Nn \c_label_delimiter_str {/}
|
||||
\str_const:Nn \c_label_parent_str {.}
|
||||
\str_const:Nn \c_label_wildcard_str {~}
|
||||
\str_const:Nn \c_appendices_label_str {appendices}
|
||||
\str_const:Nn \c_@@_label_delimiter_str {/}
|
||||
\str_const:Nn \c_@@_label_parent_str {.}
|
||||
\str_const:Nn \c_@@_label_wildcard_str {~}
|
||||
\str_const:Nn \c_@@_appendices_label_str {appendices}
|
||||
|
||||
\seq_new:N \g_label_seq
|
||||
\seq_new:N \g_@@_label_seq
|
||||
\seq_gclear:N \g_@@_label_seq
|
||||
|
||||
\NewDocumentCommand{\Part}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {part} {#1} {#2} {#3} {#4}
|
||||
\RenewDocumentCommand{\parttitle}{}{#2}
|
||||
\@@_heading:nnnnn {part} {#1} {#2} {#3} {#4}
|
||||
\RenewDocumentCommand{\parttitle}{}{#3}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Chapter}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {chapter} {#1} {#2} {#3} {#4}
|
||||
\@@_heading:nnnnn {chapter} {#1} {#2} {#3} {#4}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Section}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {section} {#1} {#2} {#3} {#4}
|
||||
\@@_heading:nnnnn {section} {#1} {#2} {#3} {#4}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Subsection}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {subsection} {#1} {#2} {#3} {#4}
|
||||
\@@_heading:nnnnn {subsection} {#1} {#2} {#3} {#4}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Subsubsection}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {subsubsection} {#1} {#2} {#3} {#4}
|
||||
\@@_heading:nnnnn {subsubsection} {#1} {#2} {#3} {#4}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Paragraph}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {paragraph} {#1} {#2} {#3} {#4}
|
||||
\@@_heading:nnnnn {paragraph} {#1} {#2} {#3} {#4}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Subparagraph}{s t^ m >{\TrimSpaces}m}{
|
||||
\_heading:nnnnn {subparagaph} {#1} {#2} {#3} {#4}
|
||||
\@@_heading:nnnnn {subparagaph} {#1} {#2} {#3} {#4}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\Appendices}{}{
|
||||
\_heading:nnnnn {part} {\c_true_bool} {\c_false_bool} {Appendices} {\c_appendices_label_str}
|
||||
\@@_heading:nnnnn {part} {\c_true_bool} {\c_false_bool} {Appendices} {\c_@@_appendices_label_str}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\GetCurrentLabel}{}{
|
||||
\seq_use:Nn \g_label_seq {\c_label_delimiter_str}
|
||||
\seq_use:Nn \g_@@_label_seq {\c_@@_label_delimiter_str}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\SetCurrentLabel}{
|
||||
% #1: Delimiter
|
||||
O{\c_label_delimiter_str}
|
||||
O{\c_@@_label_delimiter_str}
|
||||
% #2: Label string.
|
||||
>{\TrimSpaces}m
|
||||
}{
|
||||
\seq_set_split:Nnn \g_label_seq {#1} {#2}
|
||||
\seq_set_split:Nnn \g_@@_label_seq {#1} {#2}
|
||||
}
|
||||
|
||||
\RenewDocumentCommand{\Ref}{
|
||||
% #1: Star (No star = include section name in reference, star = do not include).
|
||||
s
|
||||
% #2: Label string delimiter (defaults to "/").
|
||||
O{\c_label_delimiter_str}
|
||||
O{\c_@@_label_delimiter_str}
|
||||
% #3: Label Reference
|
||||
>{\TrimSpaces}m
|
||||
% #4: Parent label symbol (defaults to ".").
|
||||
O{\c_label_parent_str}
|
||||
O{\c_@@_label_parent_str}
|
||||
% #5: Label wildcard symbol (defaults to "~").
|
||||
O{\c_label_wildcard_str}
|
||||
O{\c_@@_label_wildcard_str}
|
||||
}{ \group_begin:
|
||||
% Put the parameters in string variables so we can work with them.
|
||||
\str_const:Nn \c_label_delimiter_str {#2}
|
||||
\str_const:Nn \c_label_parent_str {#4}
|
||||
\str_const:Nn \c_label_wildcard_str {#5}
|
||||
\str_const:Ne \c_regex_str {
|
||||
/|([\c_label_parent_str\c_label_wildcard_str])
|
||||
\str_const:Nn \c_@@_label_delimiter_str {#2}
|
||||
\str_const:Nn \c_@@_label_parent_str {#4}
|
||||
\str_const:Nn \c_@@_label_wildcard_str {#5}
|
||||
\str_const:Ne \c_@@_regex_str {
|
||||
% MATCH delimiter, parent, and wildcard symbols, but CAPTURE only
|
||||
% parents and wildcards, NOT delimiters.
|
||||
/|(\c_@@_label_parent_str|\c_@@_label_wildcard_str)
|
||||
}
|
||||
|
||||
\seq_new:N \l_label_seq
|
||||
\seq_new:N \l_ref_seq
|
||||
\seq_new:N \l_@@_label_seq
|
||||
\seq_new:N \l_@@_ref_seq
|
||||
|
||||
\str_new:N \l_ref_str
|
||||
\str_set:Nn \l_ref_str {#3}
|
||||
\str_new:N \l_@@_ref_str
|
||||
\str_set:Nn \l_@@_ref_str {#3}
|
||||
|
||||
% Split the string on the delimiters.
|
||||
\seq_set_regex_split:NNn \l_ref_seq \c_regex_str {\l_ref_str}
|
||||
\seq_set_regex_split:NNn \l_@@_ref_seq \c_@@_regex_str {\l_@@_ref_str}
|
||||
|
||||
% Copy the current label sequence to a local variable.
|
||||
\seq_set_eq:NN \l_label_seq \g_label_seq
|
||||
\seq_set_eq:NN \l_@@_label_seq \g_@@_label_seq
|
||||
|
||||
% Iterate through the reference sequence, removing one element from the
|
||||
% end of the temporary label sequence for each parent symbol.
|
||||
\seq_map_indexed_function:NN \l_ref_seq \_seq_map:nn
|
||||
\seq_map_indexed_function:NN \l_@@_ref_seq \_seq_map:nn
|
||||
|
||||
% If the first character in the label string is a delimiter, it is an
|
||||
% absolute reference and we don't have to do anything to it.
|
||||
% Otherwise, we have to convert it from a relative reference to an absolute.
|
||||
\str_if_eq:nnTF {\str_head:N \l_ref_str} {\c_label_delimiter_str} {
|
||||
% % Add the shortened temporary label sequence to the beginning of the
|
||||
% % reference sequence.
|
||||
\seq_concat:NNN \l_@@_ref_seq \l_@@_label_seq \l_@@_ref_seq
|
||||
|
||||
} {
|
||||
% Add a delimiter before each parent symbol so we can split the string.
|
||||
\str_replace_all:Nnn \l_ref_str {\c_label_parent_str} {
|
||||
\c_label_delimiter_str\c_label_parent_str
|
||||
}
|
||||
% Remove empty items from the sequence.
|
||||
\seq_remove_all:Nn \l_ref_seq {}
|
||||
% Add the shortened temporary label sequence to the beginning of the
|
||||
% reference sequence.
|
||||
\seq_concat:NNN \l_ref_seq \l_label_seq \l_ref_seq
|
||||
% Join the reference sequence back into a delimited string.
|
||||
\str_set:Nn \l_ref_str {\seq_use:Nn \l_ref_seq {#1}}
|
||||
\str_put_left:Nn \l_ref_str {\c_label_delimiter_str}
|
||||
% % Join the reference sequence back into a delimited string.
|
||||
\str_set:Nn \l_@@_ref_str {\seq_use:Nn \l_@@_ref_seq {#1}}
|
||||
|
||||
\str_if_eq:nnF {\str_head:N \l_@@_ref_str} {\c_@@_label_delimiter_str} {
|
||||
\str_put_left:Nn \l_@@_ref_str {\c_@@_label_delimiter_str}
|
||||
}
|
||||
|
||||
% Output the section name only if no star is passed.
|
||||
\bool_if:nF {#1} {
|
||||
\str_if_eq:nnTF {\seq_item:Nn \l_ref_seq {1}} {\c_appendices_label_str} {
|
||||
\str_if_eq:nnTF {\seq_item:Nn \l_@@_ref_seq {1}} {\c_@@_appendices_label_str} {
|
||||
% If the part label is "appendices", the section name is "Appendix".
|
||||
\prop_item:Nn \c_section_names_prop {9}
|
||||
\prop_item:Nn \c_@@_section_names_prop {9}
|
||||
}{
|
||||
% Otherwise, look up the correct section name.
|
||||
\prop_item:Nn \c_section_names_prop {\seq_count:N \l_ref_seq - 1}
|
||||
\prop_item:Nn \c_@@_section_names_prop {\seq_count:N \l_@@_ref_seq - 1}
|
||||
}
|
||||
}
|
||||
% Create a reference with the string we just created.
|
||||
\ref{\l_ref_str}
|
||||
\ref{\l_@@_ref_str}
|
||||
|
||||
\cs_new:Nn \_seq_map:nn {
|
||||
\str_case:nn {#2} {
|
||||
{\c_label_parent_str} {\seq_pop_right:NN \l_label_seq \l_tmpa_tl}
|
||||
{\c_label_wildcard_str} {
|
||||
\seq_item:Nn \l_label_temp_str {#1}}
|
||||
{\c_@@_label_parent_str} {
|
||||
\seq_pop_right:NN \l_@@_label_seq \l_@@_tmpa_tl
|
||||
\seq_pop_left:NN \l_@@_ref_seq \l_@@_tmpa_tl
|
||||
}
|
||||
{\c_@@_label_wildcard_str} {
|
||||
\seq_pop_left:NN \l_@@_label_seq \l_@@_tmpa_tl
|
||||
\l_@@_tmpa_tl
|
||||
}
|
||||
}
|
||||
}
|
||||
\group_end: }
|
||||
|
||||
\int_new:N \l_level_index_int
|
||||
\int_new:N \l_section_level_int
|
||||
\int_new:N \l_@@_current_level_int
|
||||
\int_new:N \l_@@_pop_count_int
|
||||
\int_new:N \l_@@_pop_index_int
|
||||
|
||||
\cs_new:Nn \_heading:nnnnn {
|
||||
\seq_new:N \l_@@_label_seq
|
||||
|
||||
\str_new:N \l_@@_label_str
|
||||
|
||||
\cs_new:Nn \@@_heading:nnnnn { \group_begin:
|
||||
% #1: Section name: part, chapter, section, etc.
|
||||
% #2: Star (passed to default sectioning command)
|
||||
% #3: ^ token: suppresses sectioning command.
|
||||
% #4: Section title
|
||||
% #5: Label
|
||||
|
||||
\prop_get:NnN \c_section_levels_prop {#1} \l_section_level_int
|
||||
\debug_on:n {all}
|
||||
|
||||
% Get the numeric level of the section command.
|
||||
\prop_get:NnN \c_@@_section_levels_prop {#1} \l_@@_current_level_int
|
||||
|
||||
% \message{^^J@@_heading:~#5~\seq_use:Ne \g_@@_label_seq {\c_@@_label_delimiter_str}}
|
||||
|
||||
\seq_set_eq:NN \l_@@_label_seq \g_@@_label_seq
|
||||
|
||||
\int_set:Nn \l_@@_pop_count_int {
|
||||
\seq_count:N \l_@@_label_seq - \l_@@_current_level_int
|
||||
}
|
||||
|
||||
\int_while_do:nNnn {\l_@@_pop_index_int} < {\l_@@_pop_count_int} {
|
||||
\seq_if_empty:NF \l_@@_label_seq {
|
||||
\seq_pop_right:NN \l_@@_label_seq \l_tmpa_tl
|
||||
}
|
||||
\int_incr:N \l_@@_pop_index_int
|
||||
}
|
||||
|
||||
% Add the new label to the end of the modified label sequence.
|
||||
\seq_put_right:Ne \l_@@_label_seq {#5}
|
||||
|
||||
\seq_gset_eq:NN \g_@@_label_seq \l_@@_label_seq
|
||||
|
||||
% Join the label sequence into a string.
|
||||
\str_set:Ne \l_@@_label_str {
|
||||
\seq_use:Ne \l_@@_label_seq {\c_@@_label_delimiter_str}
|
||||
}
|
||||
|
||||
% Add a delimiter to the beginning of the label string to indicate this is
|
||||
% an absolute reference.
|
||||
\str_put_left:Ne \l_@@_label_str {\c_@@_label_delimiter_str}
|
||||
|
||||
% If the caret argument is NOT present, output the heading.
|
||||
\bool_if:nF {#3} {
|
||||
% Pass along the star argument if it is present.
|
||||
\bool_if:nTF {#2} {
|
||||
\use:c {#1} * {#4}
|
||||
} {
|
||||
\use:c {#1} {#4}
|
||||
}
|
||||
}
|
||||
\int_set:Nn \l_level_index_int {\seq_count:N \g_label_seq}
|
||||
\int_do_while:nNnn {\l_level_index_int} > {\l_section_level_int} {
|
||||
\seq_pop_right:NN \g_label_seq \l_tmpa_tl
|
||||
\int_decr:N \l_level_index_int
|
||||
}
|
||||
\seq_put_right:Nn \g_label_seq {#5}
|
||||
\str_set:Nn \l_label_str {\seq_use:Nn \g_label_seq \c_label_delimiter_str}
|
||||
\str_put_left:Nn \l_label_str {\c_label_delimiter_str}
|
||||
\exp_args:Ne \label {\l_label_str}
|
||||
}
|
||||
% Output the label.
|
||||
\exp_args:Ne \label {\l_@@_label_str}
|
||||
\group_end: }
|
||||
|
||||
\debug_off:n {all}
|
||||
@@ -1,5 +1,7 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/DocProperties}{2025-07-09}{1.0}{
|
||||
Commands for document and PDF properties.
|
||||
}
|
||||
|
||||
\DTMnewdatestyle{longdate}{%
|
||||
\renewcommand{\DTMdisplaydate}[4]{\number##3\ \DTMenglishmonthname{##2}\ \number##1}%
|
||||
|
||||
@@ -96,10 +96,10 @@
|
||||
}
|
||||
}
|
||||
\begin{minipage}{\linewidth}
|
||||
\ifthenelse{\boolean{isDraft}}{
|
||||
\bool_if:NTF \g_draft_bool {
|
||||
{\color{layoutColor}\rule{\textwidth}{1pt}\zws}
|
||||
#2
|
||||
}{
|
||||
} {
|
||||
#2
|
||||
}
|
||||
\end{minipage}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/Fonts}[2025-06-24]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Fonts}{2025-09-18}{1.0}{
|
||||
Font definitions.
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\fontpath}{}{PrimeTeX/fonts}
|
||||
|
||||
|
||||
@@ -112,18 +112,18 @@
|
||||
\cs_new:Nn \__WrapFig_process_options: {
|
||||
\str_case:en \l_WrapFig_margin_str {
|
||||
{inside} {
|
||||
\dim_set:Nn \l_WrapFig_hoffset_dim {\c_WrapFig_im_hoffset_dim}
|
||||
\dim_set_eq:NN \l_WrapFig_hoffset_dim \c_WrapFig_im_hoffset_dim
|
||||
\str_set:Nn \l_WrapFig_placement_str {i}
|
||||
}
|
||||
{outside} {
|
||||
\dim_set:Nn \l_WrapFig_hoffset_dim {\c_WrapFig_om_hoffset_dim}
|
||||
\dim_set_eq:NN \l_WrapFig_hoffset_dim \c_WrapFig_om_hoffset_dim
|
||||
\str_set:Nn \l_WrapFig_placement_str {o}
|
||||
}
|
||||
}
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\str_replace_all:Nnn \l_WrapFig_placement_str {i} {l}
|
||||
\str_replace_all:Nnn \l_WrapFig_placement_str {o} {r}
|
||||
}{
|
||||
} {
|
||||
\checkoddpage
|
||||
\ifoddpage
|
||||
\str_replace_all:Nnn \l_WrapFig_placement_str {i} {l}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
\NewDocumentCommand{\FrontMatter}{}{
|
||||
\pagestyle{plain}
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\pagenumbering{arabic}
|
||||
}{
|
||||
\pagenumbering{roman}
|
||||
@@ -48,17 +48,17 @@
|
||||
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
|
||||
|
||||
\fancypagestyle{fancy}{
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\fancyhfoffset[L]{\HeaderInsideOffset}
|
||||
\fancyhfoffset[R]{\HeaderOutsideOffset}
|
||||
\fancyhead[L]{\partlabel}
|
||||
\fancyhead[R]{\chapappname{}\leftmark}
|
||||
\fancyhead[R]{\bool_if:NT \g_label_bool {\chapappname} \leftmark}
|
||||
|
||||
\fancyfoot[R]{\thepage}
|
||||
}{
|
||||
\fancyhfoffset[LE,RO]{\HeaderOutsideOffset}
|
||||
\fancyhead[LE]{\partlabel}
|
||||
\fancyhead[RO]{\chapappname\leftmark}
|
||||
\fancyhead[RO]{\bool_if:NT \g_label_bool {\chapappname} \leftmark}
|
||||
|
||||
\fancyfoot[LE,RO]{\thepage}
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
\renewcommand{\headrulewidth}{0pt} % remove lines as well
|
||||
\renewcommand{\footrulewidth}{0pt}
|
||||
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\fancyhfoffset[L]{\HeaderInsideOffset}
|
||||
\fancyhfoffset[R]{\HeaderOutsideOffset}
|
||||
\fancyfoot[R]{\thepage}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/Hyphenation}[2025-07-11]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Hyphenation}{2025-07-11}{1.0}{
|
||||
Hyphenation definitions.
|
||||
}
|
||||
|
||||
\hyphenation{
|
||||
over-view
|
||||
|
||||
@@ -6,5 +6,6 @@
|
||||
\NewDocumentCommand{\idx}{m}{
|
||||
\str_set:Nn \l_tmpa_str {#1}
|
||||
\str_replace_all:Nnn \l_tmpa_str {!} {~}
|
||||
\l_tmpa_str
|
||||
\index{\l_tmpa_str}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/Layout}%{2025-09-03}{1.0}{Layout.}
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Layout}{2025-09-03}{1.0}{Layout.}
|
||||
|
||||
% Suppress warning about \showhyphens being changed.
|
||||
\let\CheckCommand\providecommand
|
||||
@@ -21,7 +21,7 @@
|
||||
% Suppress "Underfull \hbox" infos.
|
||||
\hbadness=10000
|
||||
|
||||
\ifthenelse{\boolean{isDraft}}{
|
||||
\bool_if:NTF \g_draft_bool{
|
||||
\geometry{showframe}
|
||||
\hfuzz = 0.5pt
|
||||
\vfuzz = 0.0pt
|
||||
@@ -44,7 +44,7 @@
|
||||
footskip = 0.5in, % 36pt,
|
||||
}
|
||||
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
% \geometry{}
|
||||
}{
|
||||
\geometry{twoside}
|
||||
@@ -65,7 +65,7 @@
|
||||
\ProvideLength{\marparwidth}[\marginparsep + \marginparwidth]
|
||||
\ProvideLength{\contentwidth}[\textwidth + \marparwidth]
|
||||
|
||||
\ifthenelse{\boolean{isDraft}}{
|
||||
\bool_if:NTF \g_draft_bool{
|
||||
\lwcsetup{showcolours=true,}
|
||||
}{}
|
||||
|
||||
@@ -89,24 +89,26 @@
|
||||
\renewcommand{\dblfloatpagefraction}{0.8} % require fuller float pages
|
||||
|
||||
\NewDocumentEnvironment{SmartAdjustWidth}{
|
||||
O{\boolean{isElectronic}}
|
||||
O{\IsElectronic}
|
||||
m
|
||||
m
|
||||
+b
|
||||
}{%
|
||||
\ifthenelse{#1}{%
|
||||
\begin{adjustwidth}{#2}{#3}%
|
||||
#4%
|
||||
\end{adjustwidth}%
|
||||
}{%
|
||||
\begin{adjustwidth*}{#2}{#3}%
|
||||
#4%
|
||||
\end{adjustwidth*}%
|
||||
}%
|
||||
}{
|
||||
\bool_if:nTF {#1} {
|
||||
\begin{adjustwidth}{#2}{#3}
|
||||
#4
|
||||
\end{adjustwidth}
|
||||
}{
|
||||
\begin{adjustwidth*}{#2}{#3}
|
||||
#4
|
||||
\end{adjustwidth*}
|
||||
}
|
||||
}{}
|
||||
|
||||
|
||||
\ExplSyntaxOff
|
||||
\AtBeginDocument{
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\If{\IsElectronic}{
|
||||
\newgeometry{
|
||||
inner = 0.75in,
|
||||
top = 66pt, % 11/12in
|
||||
@@ -119,7 +121,7 @@
|
||||
marginratio = 2:3,
|
||||
}
|
||||
\savegeometry{tinyMargin}
|
||||
}{
|
||||
}[
|
||||
\newgeometry{
|
||||
twoside = true,
|
||||
inner = 0.75in,
|
||||
@@ -134,7 +136,7 @@
|
||||
marginratio = 2:3,
|
||||
}
|
||||
\savegeometry{tinyMargin}
|
||||
}
|
||||
]
|
||||
\restoregeometry
|
||||
|
||||
\NewDocumentEnvironment{SmallMargin}{O{0.0in} O{-0.25in}}{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
bookmarksopenlevel = 2,
|
||||
}
|
||||
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\hypersetup{
|
||||
allcolors = linkColor,
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\MarginHyperSetup}{}{
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\bool_if:NTF \g_electronic_bool {
|
||||
\hypersetup{allcolors = linkColor}
|
||||
}{
|
||||
\hypersetup{allcolors = marginTextColor}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/Tables}[2025-07-09]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Tables}{2025-07-09}{1.0}{
|
||||
Tabularray configuration.
|
||||
}
|
||||
|
||||
\RenewDocumentCommand\TblrAlignBoth{}{\justifying}
|
||||
\RenewDocumentCommand\TblrAlignLeft{}{\RaggedRight}
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/TitlePage}[2025-07-09]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/TitlePage}{2025-07-09}{1.0}{
|
||||
Definition for title page.
|
||||
}
|
||||
|
||||
% Define custom title page.
|
||||
\NewDocumentCommand{\PrimeTitlePage}{O{}}{
|
||||
\thispagestyle{empty}
|
||||
\pdfbookmark{Title Page}{title-page}
|
||||
\begin{sbfamily}
|
||||
{\noindent\large\raggedright
|
||||
{\noindent\large\raggedright % Not RaggedRight because we don't want hyphens.
|
||||
\vspace*{\stretch{1}}
|
||||
|
||||
\CustomerFull
|
||||
|
||||
\medbreak
|
||||
|
||||
\ProjectTitle
|
||||
|
||||
\bigbreak
|
||||
|
||||
{\Huge\Title}
|
||||
|
||||
\vfill
|
||||
|
||||
{\leavevmode
|
||||
% Move the rule graphic to 0.25 in from the left edge of the
|
||||
% paper and vertically centered on the heartbeat graphic.
|
||||
@@ -27,9 +35,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
\AuthorCompany
|
||||
\AuthorCompany\par
|
||||
|
||||
Revision \Version
|
||||
Revision~\Version\par
|
||||
|
||||
\LongDate
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{PrimeTeX/packages/Titles}[2025-07-16]
|
||||
\ProvidesExplPackage{PrimeTeX/packages/Titles}{2025-07-16}{1.0}{
|
||||
Title formatting definitions.
|
||||
}
|
||||
|
||||
\ifthenelse{\NOT\boolean{doRomanNumerals}}{
|
||||
\bool_if:NF \g_roman_bool {
|
||||
\renewcommand{\thepart}{\arabic{part}}
|
||||
}{}
|
||||
}
|
||||
|
||||
\titleformat{\part}[display]{
|
||||
\normalfont\sbfamily\huge
|
||||
|
||||
Reference in New Issue
Block a user