- Tweak code colors.
- Debug CrossRef.
This commit is contained in:
@@ -158,9 +158,9 @@
|
|||||||
|
|
||||||
% Code snippet syntax highlighting colors.
|
% Code snippet syntax highlighting colors.
|
||||||
\colorlet{codeKeywordColor}{PrimeLightBlue}
|
\colorlet{codeKeywordColor}{PrimeLightBlue}
|
||||||
\colorlet{codeOperatorColor}{PrimeLightOrange}
|
\colorlet{codeOperatorColor}{PrimeLightPink}
|
||||||
\colorlet{codeCommentColor}{PrimeLightMint}
|
\colorlet{codeCommentColor}{PrimeLightMint}
|
||||||
\colorlet{codeNumberColor}{PrimeLightPink}
|
\colorlet{codeNumberColor}{textColor}
|
||||||
\colorlet{codeStringColor}{PrimeLightLime}
|
\colorlet{codeStringColor}{PrimeLightLime}
|
||||||
} {
|
} {
|
||||||
% Page and text colors.
|
% Page and text colors.
|
||||||
@@ -197,11 +197,11 @@
|
|||||||
\colorlet{layoutColor}{PrimePaleBlue}
|
\colorlet{layoutColor}{PrimePaleBlue}
|
||||||
|
|
||||||
% Code snippet syntax highlighting colors.
|
% Code snippet syntax highlighting colors.
|
||||||
\colorlet{codeKeywordColor}{PrimeDarkBlue}
|
\colorlet{codeKeywordColor}{PrimeBlue}
|
||||||
\colorlet{codeOperatorColor}{PrimeDarkOrange}
|
\colorlet{codeOperatorColor}{PrimePink}
|
||||||
\colorlet{codeCommentColor}{PrimeDarkMint}
|
\colorlet{codeCommentColor}{PrimeMint}
|
||||||
\colorlet{codeNumberColor}{PrimeDarkPink}
|
\colorlet{codeNumberColor}{textColor}
|
||||||
\colorlet{codeStringColor}{PrimeDarkLime}
|
\colorlet{codeStringColor}{PrimeLime}
|
||||||
}
|
}
|
||||||
|
|
||||||
\pagecolor{pageColor}
|
\pagecolor{pageColor}
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
\debug_on:n {all}
|
\debug_on:n {all}
|
||||||
|
|
||||||
\prop_const_from_keyval:Nn \c_@@_section_names_prop {
|
\prop_const_from_keyval:Nn \c_@@_section_names_prop {
|
||||||
1 = Part\nobreakspace,
|
1 = Part,
|
||||||
2 = Chapter\nobreakspace,
|
2 = Chapter,
|
||||||
3 = Section\nobreakspace,
|
3 = Section,
|
||||||
4 = Subsection\nobreakspace,
|
4 = Subsection,
|
||||||
5 = Sub-subsection\nobreakspace,
|
5 = Sub-subsection,
|
||||||
6 = Paragraph\nobreakspace,
|
6 = Paragraph,
|
||||||
7 = Subparagraph\nobreakspace,
|
7 = Subparagraph,
|
||||||
8 = Appendix\nobreakspace,
|
8 = Appendix,
|
||||||
}
|
}
|
||||||
|
|
||||||
\prop_const_from_keyval:Nn \c_@@_section_levels_prop {
|
\prop_const_from_keyval:Nn \c_@@_section_levels_prop {
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentCommand{\Subparagraph}{s t^ m >{\TrimSpaces}m}{
|
\NewDocumentCommand{\Subparagraph}{s t^ m >{\TrimSpaces}m}{
|
||||||
\@@_heading:nnnnn {subparagaph} {#1} {#2} {#3} {#4}
|
\@@_heading:nnnnn {subparagraph} {#1} {#2} {#3} {#4}
|
||||||
}
|
}
|
||||||
|
|
||||||
\NewDocumentCommand{\Appendices}{}{
|
\NewDocumentCommand{\Appendices}{}{
|
||||||
@@ -91,7 +91,6 @@
|
|||||||
|
|
||||||
% MATCH delimiter, parent, and placeholder symbols, but CAPTURE only
|
% MATCH delimiter, parent, and placeholder symbols, but CAPTURE only
|
||||||
% parents and placeholders, NOT delimiters.
|
% parents and placeholders, NOT delimiters.
|
||||||
%\regex_const:Nn \c_@@_ref_regex {\/|(\.|\*)}
|
|
||||||
\exp_args:Nne \regex_const:Nn \c_@@_ref_regex {\c_@@_label_delimiter_str|(\l_@@_esc_parent_str|\l_@@_esc_placeholder_str)}
|
\exp_args:Nne \regex_const:Nn \c_@@_ref_regex {\c_@@_label_delimiter_str|(\l_@@_esc_parent_str|\l_@@_esc_placeholder_str)}
|
||||||
\regex_log:N \c_@@_ref_regex
|
\regex_log:N \c_@@_ref_regex
|
||||||
|
|
||||||
@@ -99,6 +98,7 @@
|
|||||||
\seq_new:N \l_@@_ref_seq
|
\seq_new:N \l_@@_ref_seq
|
||||||
|
|
||||||
\str_new:N \l_@@_ref_str
|
\str_new:N \l_@@_ref_str
|
||||||
|
\str_new:N \l_@@_section_name_str
|
||||||
|
|
||||||
\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).
|
||||||
@@ -107,26 +107,38 @@
|
|||||||
>{\TrimSpaces}m
|
>{\TrimSpaces}m
|
||||||
}{ \group_begin:
|
}{ \group_begin:
|
||||||
|
|
||||||
|
%\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 {#2}
|
||||||
|
|
||||||
|
\str_set:Nn \l_@@_section_name_str {}
|
||||||
|
|
||||||
% Output the section name only if no star is passed.
|
% Output the section name only if no star is passed.
|
||||||
\bool_if:nF {#1} {
|
\bool_if:nF {#1} {
|
||||||
\str_if_eq:nnTF {
|
\str_if_eq:eeTF {
|
||||||
\seq_item:Nn \l_@@_ref_seq {1}} {\c_@@_appendices_label_str
|
\seq_item:Nn \l_@@_ref_seq {1}
|
||||||
|
} {
|
||||||
|
\c_@@_appendices_label_str
|
||||||
} {
|
} {
|
||||||
% If the part label is "appendices", the section name is "Appendix".
|
% If the part label is "appendices", the section name is "Appendix".
|
||||||
\prop_item:Nn \c_@@_section_names_prop {9}
|
\str_set:Ne \l_@@_section_name_str {\prop_item:Nn \c_@@_section_names_prop {8}}
|
||||||
} {
|
} {
|
||||||
% Otherwise, look up the correct section name.
|
% Otherwise, look up the correct section name.
|
||||||
\prop_item:Nn \c_@@_section_names_prop {
|
\str_set:Ne \l_@@_section_name_str {
|
||||||
\seq_count:N \l_@@_ref_seq - 1
|
\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.
|
||||||
\exp_args:Ne \ref {\l_@@_ref_str}
|
\hyperref [\l_@@_ref_str] {
|
||||||
|
\l_@@_section_name_str\nobreakspace\ref {\l_@@_ref_str}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
\group_end: }
|
\group_end: }
|
||||||
|
|
||||||
\NewDocumentCommand{\HiperRef}{
|
\NewDocumentCommand{\HiperRef}{
|
||||||
|
|||||||
Reference in New Issue
Block a user