- Remove dependency on amssymb.

- Add \ColorText macro to set text color in dark or normal mode.
- Merge \HiperRef into \HiRef.
- Add macros for checkbox and ballot x to replace those from amssymb.
This commit is contained in:
2025-10-03 16:48:21 -05:00
parent 534d1aa047
commit b290268986
4 changed files with 85 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
\ProvidesFile{commonincludes.def}[2025-09-02 v1.0]
\RequirePackage{amssymb}
%\RequirePackage{amssymb}
\RequirePackage{calc}

View File

@@ -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

View File

@@ -100,21 +100,36 @@
\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 {}
% Create a reference with the string we just created.
\hyperref [\l_@@_ref_str] {
\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 {
@@ -123,7 +138,9 @@
\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}}
\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 {
@@ -133,31 +150,34 @@
}
}
}
% 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
}
\ref {\l_@@_ref_str}
\ref* {\l_@@_ref_str}
}
} {
#4
}
}
\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.

View File

@@ -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]