- 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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user