| 1 |
|
| 2 |
\SimpleSystemTeX allows users to customize \newconcept{Style Code} by using the \cs{SetStyle} command in the preamble, thereby setting or modifying the styling of various document components. In addition to standard \LaTeX\ commands, users can also utilize \newconcept{Display Arguments} prefixed with \texttt{@} within the style code to dynamically extract document content. The values of these arguments can similarly be evaluated in conditional statements to achieve highly flexible typesetting effects. |
| 3 |
|
| 4 |
\UserCommand{Configure Style}{ |
| 5 |
\cs{SetStyle} |
| 6 |
\{\meta{style}\} |
| 7 |
\{\meta{style code}\longarg\} |
| 8 |
}[ |
| 9 |
- \meta{style} : The name of the style to be set or modified. |
| 10 |
][ |
| 11 |
- \meta{style code}\longarg\ : The \LaTeX\ code used to define the appearance of the style. You may use standard \LaTeX\ commands for typesetting, display arguments prefixed with \texttt{@} , and the following conditional statements prefixed with \texttt{\#} : |
| 12 |
- - \texttt{\#ifempty} : Evaluates whether a display argument is empty. |
| 13 |
\LocalUsage{ifempty}(\#ifempty){ |
| 14 |
\upshape |
| 15 |
\#ifempty |
| 16 |
@\meta{argument} |
| 17 |
\{\meta{true code}\longarg\} |
| 18 |
\{\meta{false code}\longarg\} |
| 19 |
} |
| 20 |
- - \texttt{\#ifis} : Evaluates whether a display argument, after one level of expansion, equals a |
| 21 |
\par\indent\indent\indent\indent specific value. |
| 22 |
\LocalUsage{ifis}(\#ifis){ |
| 23 |
\upshape |
| 24 |
\#ifis |
| 25 |
@\meta{argument} |
| 26 |
\{\meta{value}\} |
| 27 |
\{\meta{true code}\longarg\} |
| 28 |
\{\meta{false code}\longarg\} |
| 29 |
} |
| 30 |
- - \texttt{\#ifequal} : Evaluates whether two display arguments, after one level of expansion, |
| 31 |
\par\indent\indent\indent\indent\indent are equal to each other. |
| 32 |
\LocalUsage{ifequal}(\#ifequal){ |
| 33 |
\upshape |
| 34 |
\#ifequal |
| 35 |
@\meta{argument1} |
| 36 |
@\meta{argument2} |
| 37 |
\{\meta{true code}\longarg\} |
| 38 |
\{\meta{false code}\longarg\} |
| 39 |
} |
| 40 |
] |
| 41 |
|
| 42 |
When writing style code, please ensure that a display argument does not immediately follow any macro command, as this may lead to syntax parsing errors. You must insert a space before the \texttt{@} to prevent this issue, for example: \cs{par}\texttt{ @\meta{argument}} . |
| 43 |
|
| 44 |
\newpage Customizable styles and their respective available display arguments include: |
| 45 |
|
| 46 |
\List{TOC Style}(\large Table of Contents){ |
| 47 |
\par\medskip{} |
| 48 |
- \textbf{\texttt{TOCTitle} : Title of the table of contents}. |
| 49 |
- \textbf{\texttt{TOCPartTitle} : Part title in the table of contents}. |
| 50 |
- - \texttt{@part} : Part. |
| 51 |
- \textbf{\texttt{TOCSection} : Section entry in the table of contents}. |
| 52 |
- - \texttt{@section} : Entry section file name. |
| 53 |
- - \texttt{@sectionname} : Entry section's display name. |
| 54 |
- - \texttt{@part} : Part containing the entry section. |
| 55 |
- - \texttt{@group} , \texttt{@subgroup} ... : Top-level group, second-level group... containing the entry section. |
| 56 |
- - \texttt{@sectionpath} : Entry section path. |
| 57 |
- - \texttt{@sectionpage} : Page number where the entry section heading is located. |
| 58 |
- - \texttt{@sectionparameter} : Custom parameter of the entry section. |
| 59 |
} |
| 60 |
|
| 61 |
\List{Section Style}(\large Section){ |
| 62 |
\par\medskip{} |
| 63 |
- \textbf{\texttt{SectionHeading} : Section Heading}. |
| 64 |
- - \texttt{@section} : Section file name. |
| 65 |
- - \texttt{@sectionname} : Section's display name. |
| 66 |
- - \texttt{@part} : Part containing the section. |
| 67 |
- - \texttt{@group} , \texttt{@subgroup} ... : Top-level group, second-level group... containing the section. |
| 68 |
- - \texttt{@sectionpath} : Section path. |
| 69 |
- - \texttt{@sectionpage} : Page number where the section heading is located. |
| 70 |
- - \texttt{@sectionparameter} : Custom parameter of the section. |
| 71 |
- \textbf{\meta{block type} : Block}. |
| 72 |
- - \texttt{@section} , \texttt{@sectionname} ... : (Display arguments of the containing section) |
| 73 |
- - \texttt{@block} : Block's label, not available for anonymous blocks. |
| 74 |
- - \texttt{@blockname} : Block's display name. |
| 75 |
- - \texttt{@blockparameter} : Custom parameter of the block. |
| 76 |
- - \texttt{@blockcontent} : Block's content. |
| 77 |
} |
| 78 |
|
| 79 |
\newpage |
| 80 |
|
| 81 |
\List{Block Index Style}(\large Block Index){ |
| 82 |
\par\medskip{} |
| 83 |
- \textbf{\texttt{IndexTitle} , \texttt{IndexSubtitle} ... : Titles of top-level group, second-level group... in the block index}. |
| 84 |
- - \texttt{@section} , \texttt{@sectionname} ... : (Display arguments of the containing section) |
| 85 |
- - \texttt{@indexgroup} , \texttt{@indexsubgroup} ... : Top-level group, second-level group... in the block index's scope path. |
| 86 |
- - \texttt{@indexparameter} : Custom parameter of the block index. |
| 87 |
- \textbf{\texttt{IndexBlock} : Entry in the block index}. |
| 88 |
- - \texttt{@section} , \texttt{@sectionname} ... : (Display arguments of the containing section) |
| 89 |
- - \texttt{@indexparameter} : Custom parameter of the block index. |
| 90 |
- - \texttt{@indexblock} : Entry block's label, not available for anonymous blocks. |
| 91 |
- - \texttt{@indexblockname} : Entry block's display name. |
| 92 |
- - \texttt{@indexblockparameter} : Custom parameter of the entry block. |
| 93 |
- - \texttt{@indexsection} : Section file name containing the entry block. |
| 94 |
- - \texttt{@indexsectionname} : Display name of the section containing the entry block. |
| 95 |
- - \texttt{@indexpart} : Part containing the entry block. |
| 96 |
- - \texttt{@indexgroup} , \texttt{@indexsubgroup} ... : Top-level group, second-level group... containing the entry block. |
| 97 |
- - \texttt{@indexsectionpath} : Section path containing the entry block. |
| 98 |
- - \texttt{@indexsectionparameter} : Custom parameter of the section containing the entry block. |
| 99 |
} |
| 100 |
|
| 101 |
\List{Cross-Reference Style}(\large Cross-Reference){ |
| 102 |
\par\medskip{} |
| 103 |
- \textbf{\texttt{SectionLink} : Section Link}. |
| 104 |
- - \texttt{@section} , \texttt{@sectionname} ... : (Display arguments of the containing section) |
| 105 |
- - \texttt{@block} , \texttt{@blockname} ... : (Display arguments of the containing block) |
| 106 |
- - \texttt{@linktext} : Link text. |
| 107 |
- - \texttt{@targetsection} : Target section file name. |
| 108 |
- - \texttt{@targetsectionname} : Target section's display name. |
| 109 |
- - \texttt{@targetpart} : Part containing the target section. |
| 110 |
- - \texttt{@targetgroup} , \texttt{@targetsubgroup} ... : Top-level group, second-level group... containing the target section. |
| 111 |
- - \texttt{@targetsectionpath} : Target section path. |
| 112 |
- - \texttt{@targetsectionpage} : Page number where the target section heading is located. |
| 113 |
- - \texttt{@targetsectionparameter} : Custom parameter of the target section. |
| 114 |
\newpage{} |
| 115 |
- \textbf{\texttt{BlockLink} : Block Link}. |
| 116 |
- - \texttt{@section} , \texttt{@sectionname} ... : (Display arguments of the containing section) |
| 117 |
- - \texttt{@block} , \texttt{@blockname} ... : (Display arguments of the containing block) |
| 118 |
- - \texttt{@linktext} : Link text. |
| 119 |
- - \texttt{@targetblock} : Target block's label, not available for anonymous blocks. |
| 120 |
- - \texttt{@targetblockname} : Target block's display name. |
| 121 |
- - \texttt{@targetblockparameter} : Custom parameter of the target block. |
| 122 |
- \textbf{\texttt{IndexLink} : Index Link}. |
| 123 |
- - \texttt{@section} , \texttt{@sectionname} ... : (Display arguments of the containing section) |
| 124 |
- - \texttt{@block} , \texttt{@blockname} ... : (Display arguments of the containing block) |
| 125 |
- - \texttt{@linktext} : Link text. |
| 126 |
- - \texttt{@targetgroup} , \texttt{@targetsubgroup} ... : Top-level group, second-level group... in the target index's scope path. |
| 127 |
- - \texttt{@targetindexparameter} : Custom parameter of the target index. |
| 128 |
} |
| 129 |
|
| 130 |
Not all display arguments are intended for rendering content. For instance, if \texttt{@section} contains special characters, you might use \texttt{@sectionname} as a substitute. In such scenarios, \texttt{@section} should be used to provide the section file name for conditional evaluation, whereas \texttt{@sectionname} should be used for display in the document. Please select the appropriate display arguments according to your specific requirements when authoring style code. |
| 131 |
|
| 132 |
Please avoid the following practices within your style code, as they may lead to errors such as scope conflicts among display arguments: |
| 133 |
|
| 134 |
\BadPractice{Style Code-Bad Practice}{ |
| 135 |
- Do not leave label-type arguments containing special characters, like \texttt{@section}, directly exposed in the style code. |
| 136 |
- Do not nest blocks in the style code of \meta{block type} . |
| 137 |
- Do not nest links in the style code of \textbf{\texttt{SectionLink}}, \textbf{\texttt{BlockLink}}, or \textbf{\texttt{IndexLink}}. |
| 138 |
- Do not use \texttt{@blockcontent} in the style code of \textbf{\texttt{SectionLink}}, \textbf{\texttt{BlockLink}}, or \textbf{\texttt{IndexLink}}. |
| 139 |
- Do not compare path-type arguments like \texttt{@sectionpath} with other arguments like \texttt{@section} or their concatenated values, because they possess different \TeX\ catcodes. |
| 140 |
} |
| 141 |
|
| 142 |
Before authoring style code, please review the \seclink{StyleCodePresetValues}. \textcolor{orange}{It is highly recommended to copy the specific portions you intend to modify into the preamble first}, and then base your further adjustments upon them. |
| 143 |
|
| 144 |
\newpage |