diff --git a/commonincludes.def b/commonincludes.def index aee911a..69e8558 100644 --- a/commonincludes.def +++ b/commonincludes.def @@ -1,6 +1,6 @@ \ProvidesFile{commonincludes.def}[2025-09-02 v1.0] -\RequirePackage{amssymb} +%\RequirePackage{amssymb} \RequirePackage{calc} diff --git a/packages/Color.sty b/packages/Color.sty index 2b07af3..c410e39 100644 --- a/packages/Color.sty +++ b/packages/Color.sty @@ -209,6 +209,22 @@ \colorlet{boxedcoloroutline}{textColor} +\NewDocumentCommand{\ColorText}{ + O{PrimeBlue} + O{PrimeBrightBlue} + O{} + +m +}{ + \group_begin: + \bool_if:NTF \g_dark_mode_bool { + \color{#2} + } { + \color{#1} + } + #3 #4 + \group_end: +} + \NewDocumentCommand{\boxedcolor}{ % #1: Text inside box. o diff --git a/packages/CrossRef.sty b/packages/CrossRef.sty index 83405e2..c1ceec7 100644 --- a/packages/CrossRef.sty +++ b/packages/CrossRef.sty @@ -100,64 +100,84 @@ \str_new:N \l_@@_ref_str \str_new:N \l_@@_section_name_str +\keys_define:nn {HiRef} { + page .bool_set:N = \l_@@_page_bool, +} + \NewDocumentCommand{\HiRef}{ % #1: Star (No star = include section name in reference, star = do not include). s - % #2: Label Reference + % #2: Key-value arguments. + O{} + % #3: Label Reference. >{\TrimSpaces}m + % #4: Link text. + O{} }{ \group_begin: + \keys_set:nn {HiRef} {#2} %\prop_show:N \c_@@_section_names_prop %\str_set:Ne \l_@@_ref_str {#2} - \@@_HiRef_process:Nn \l_@@_ref_str {#2} + \@@_HiRef_process:Nn \l_@@_ref_str {#3} \str_set:Nn \l_@@_section_name_str {} - % Output the section name only if no star is passed. - \bool_if:nF {#1} { - \str_if_eq:eeTF { - \seq_item:Nn \l_@@_ref_seq {1} - } { - \c_@@_appendices_label_str - } { - % If the part label is "appendices", the section name is "Appendix". - \str_set:Ne \l_@@_section_name_str {\prop_item:Nn \c_@@_section_names_prop {8}} - } { - % Otherwise, look up the correct section name. - \str_set:Ne \l_@@_section_name_str { - \prop_item:Ne \c_@@_section_names_prop { - \int_eval:n{\seq_count:N \l_@@_ref_seq} - } - } - } - } % Create a reference with the string we just created. \hyperref [\l_@@_ref_str] { - \str_if_empty:NF \l_@@_section_name_str { - \l_@@_section_name_str \nobreakspace + \str_if_empty:nTF {#4} { + \bool_if:NTF \l_@@_page_bool { + \bool_if:nF {#1} {Page}~\pageref* {\l_@@_ref_str} + } { + % Output the section name only if no star is passed. + \bool_if:nF {#1} { + \str_if_eq:eeTF { + \seq_item:Nn \l_@@_ref_seq {1} + } { + \c_@@_appendices_label_str + } { + % If the part label is "appendices", the section name is "Appendix". + \str_set:Ne \l_@@_section_name_str { + \prop_item:Nn \c_@@_section_names_prop {8} + } + } { + % Otherwise, look up the correct section name. + \str_set:Ne \l_@@_section_name_str { + \prop_item:Ne \c_@@_section_names_prop { + \int_eval:n{\seq_count:N \l_@@_ref_seq} + } + } + } + } + \str_if_empty:NF \l_@@_section_name_str { + \l_@@_section_name_str \nobreakspace + } + \ref* {\l_@@_ref_str} + } + } { + #4 } - \ref {\l_@@_ref_str} } \group_end: } -\NewDocumentCommand{\HiperRef}{ - % #1: Label reference. - >{\TrimSpaces}m - % #2: Display text. - m -}{ \group_begin: +% Deprecated in favor of \HiRef{label}[text] +% \NewDocumentCommand{\HiperRef}{ +% % #1: Label reference. +% >{\TrimSpaces}m +% % #2: Display text. +% m +% }{ \group_begin: - %\str_set:Ne \l_@@_ref_str {#1} +% %\str_set:Ne \l_@@_ref_str {#1} - \@@_HiRef_process:Nn \l_@@_ref_str {#1} +% \@@_HiRef_process:Nn \l_@@_ref_str {#1} - \hyperref[\l_@@_ref_str]{#2} +% \hyperref[\l_@@_ref_str]{#2} -\group_end: } +% \group_end: } \cs_new:Nn \@@_HiRef_process:Nn { % Split the string on the delimiters. diff --git a/packages/Fonts.sty b/packages/Fonts.sty index 1df9350..1d53434 100644 --- a/packages/Fonts.sty +++ b/packages/Fonts.sty @@ -97,6 +97,21 @@ \NewDocumentCommand{\abl}{}{{\symfamily ❬}} \NewDocumentCommand{\abr}{}{{\symfamily ❭}} +\NewDocumentCommand{\checkmark}{s O{PrimeGreen} O{PrimeBrightGreen}}{ + \bool_if:nTF {#1} { + \ColorText[#2][#3][\symfamily]{✓} + } { + {\symfamily ✓} + } +} +\NewDocumentCommand{\xmark}{s O{PrimeRed} O{PrimeBrightRed}}{ + \bool_if:nTF {#1} { + \ColorText[#2][#3][\symfamily]{✗} + } { + {\symfamily ✗} + } +} + % MenuKeys configuration. \newmenucolortheme{autoModeColor}{named}{pageColor}{textColor}{textColor}[pageColor][textColor][textColor]