- 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:
@@ -1,6 +1,6 @@
|
|||||||
\ProvidesFile{commonincludes.def}[2025-09-02 v1.0]
|
\ProvidesFile{commonincludes.def}[2025-09-02 v1.0]
|
||||||
|
|
||||||
\RequirePackage{amssymb}
|
%\RequirePackage{amssymb}
|
||||||
|
|
||||||
\RequirePackage{calc}
|
\RequirePackage{calc}
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,22 @@
|
|||||||
|
|
||||||
\colorlet{boxedcoloroutline}{textColor}
|
\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}{
|
\NewDocumentCommand{\boxedcolor}{
|
||||||
% #1: Text inside box.
|
% #1: Text inside box.
|
||||||
o
|
o
|
||||||
|
|||||||
@@ -100,64 +100,84 @@
|
|||||||
\str_new:N \l_@@_ref_str
|
\str_new:N \l_@@_ref_str
|
||||||
\str_new:N \l_@@_section_name_str
|
\str_new:N \l_@@_section_name_str
|
||||||
|
|
||||||
|
\keys_define:nn {HiRef} {
|
||||||
|
page .bool_set:N = \l_@@_page_bool,
|
||||||
|
}
|
||||||
|
|
||||||
\NewDocumentCommand{\HiRef}{
|
\NewDocumentCommand{\HiRef}{
|
||||||
% #1: Star (No star = include section name in reference, star = do not include).
|
% #1: Star (No star = include section name in reference, star = do not include).
|
||||||
s
|
s
|
||||||
% #2: Label Reference
|
% #2: Key-value arguments.
|
||||||
|
O{}
|
||||||
|
% #3: Label Reference.
|
||||||
>{\TrimSpaces}m
|
>{\TrimSpaces}m
|
||||||
|
% #4: Link text.
|
||||||
|
O{}
|
||||||
}{ \group_begin:
|
}{ \group_begin:
|
||||||
|
\keys_set:nn {HiRef} {#2}
|
||||||
|
|
||||||
%\prop_show:N \c_@@_section_names_prop
|
%\prop_show:N \c_@@_section_names_prop
|
||||||
|
|
||||||
%\str_set:Ne \l_@@_ref_str {#2}
|
%\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 {}
|
\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.
|
% Create a reference with the string we just created.
|
||||||
\hyperref [\l_@@_ref_str] {
|
\hyperref [\l_@@_ref_str] {
|
||||||
\str_if_empty:NF \l_@@_section_name_str {
|
\str_if_empty:nTF {#4} {
|
||||||
\l_@@_section_name_str \nobreakspace
|
\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: }
|
\group_end: }
|
||||||
|
|
||||||
\NewDocumentCommand{\HiperRef}{
|
% Deprecated in favor of \HiRef{label}[text]
|
||||||
% #1: Label reference.
|
% \NewDocumentCommand{\HiperRef}{
|
||||||
>{\TrimSpaces}m
|
% % #1: Label reference.
|
||||||
% #2: Display text.
|
% >{\TrimSpaces}m
|
||||||
m
|
% % #2: Display text.
|
||||||
}{ \group_begin:
|
% 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 {
|
\cs_new:Nn \@@_HiRef_process:Nn {
|
||||||
% Split the string on the delimiters.
|
% Split the string on the delimiters.
|
||||||
|
|||||||
@@ -97,6 +97,21 @@
|
|||||||
\NewDocumentCommand{\abl}{}{{\symfamily ❬}}
|
\NewDocumentCommand{\abl}{}{{\symfamily ❬}}
|
||||||
\NewDocumentCommand{\abr}{}{{\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.
|
% MenuKeys configuration.
|
||||||
\newmenucolortheme{autoModeColor}{named}{pageColor}{textColor}{textColor}[pageColor][textColor][textColor]
|
\newmenucolortheme{autoModeColor}{named}{pageColor}{textColor}{textColor}[pageColor][textColor][textColor]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user