Debian Codegraph @

texmf-dist/doc/latex/simplesystemtex/sec/Text/CreatingBlocks.tex

raw
1
2 You can use the following commands in the text or \blclink{Style Code} to create a block of an already defined block type:
3
4 \UserCommand{Create Block}<\cs{\meta{regular block type}} , \cs{\meta{anonymous block type}}>{
5 \cs{\meta{regular block type}}
6 \{\meta{label}\}
7 (\meta{display name})
8 <\meta{custom parameter}>
9 \{\meta{content}\longarg\}
10 \AnotherUsage
11 \cs{\meta{anonymous block type}}
12 (\meta{display name})
13 <\meta{custom parameter}>
14 \{\meta{content}\longarg\}
15 }[
16 - \meta{regular block type} , \meta{anonymous block type} : The name of the block type to be created.
17 - \meta{label} : The unique identifier of the block. Do not start with a \texttt{.} .
18 - \meta{content}\longarg\ : The specific content of the block.
19 ][
20 - \meta{display name} : The name of the block used for display. If this argument is empty, the \meta{label} will be used by default.
21 - \meta{custom parameter} : Used in \seclink{Preamble/StyleConfiguration} to achieve various complex typesetting logic.
22 ]
23
24 \AutomaticListoff
25
26 \Example{创建区块-示例}{
27 \par\noindent \cs{Theorem} \{Orthonormality Lemma\} \{
28 \par Let \$(\cs{bm} e\_k)\_\{k=1\}\^{}n\$ be an orthonormal system of vectors, then
29 \par \cs{begin}\{align*\}
30 \par\indent\indent \cs{forall} (a\_k)\_\{k=1\}\^{}n \cs{in} \cs{mathbf}\{F\}\^{}n
31 \par\indent\indent \cs{left}|\cs{left}| \cs{sum}\_\{k=1\}\^{}n a\_k \cs{bm} e\_k \cs{right}|\cs{right}|\^{}2
32 \par\indent\indent = \cs{sum}\_\{k=1\}\^{}n \cs{left}| a\_k \cs{right}|\^{}2 \cs{ }.
33 \par\cs{end}\{align*\}
34 \par\noindent \}
35 \par\noindent \cs{Proof} \{Orthonormality Lemma-proof1\} (Proof I) \{
36 \par \cs{begin}\{align*\}
37 \par\indent\indent \cs{left}|\cs{left}| \cs{sum}\_\{k=1\}\^{}n a\_k \cs{bm} e\_k \cs{right}|\cs{right}|\^{}2
38 \par\indent\indent = \cs{left}\cs{langle} \cs{sum}\_\{k=1\}\^{}n a\_k \cs{bm} e\_k\cs{ },\cs{ }\cs{sum}\_\{k=1\}\^{}n a\_k \cs{bm} e\_k
39 \par\indent\indent\cs{right}\cs{rangle}
40 \par\indent\indent = \cs{sum}\_\{i=1\}\^{}n \cs{sum}\_\{j=1\}\^{}n a\_i \cs{overline}\{a\_\{j\}\} \cs{delta}\_\{i,j\}
41 \par\indent\indent = \cs{sum}\_\{k=1\}\^{}n | a\_k |\^{}2 \cs{ }.
42 \par \cs{end}\{align*\}
43 \par\noindent \}
44 \newpage
45 \par\noindent \cs{Proof} \{Orthonormality Lemma-proof2\} (Proof II) <Induction> \{
46 \par \cs{par} For \$n=1\$ , we have
47 \par \cs{begin}\{align*\}
48 \par\indent\indent || a\_1 \cs{bm} e\_1 || = | a\_1 | || \cs{bm} e\_1 || = | a\_1 | \cs{ }.
49 \par \cs{end}\{align*\}
50 \par \cs{par} Suppose the proposition holds for \$n=m\$ . By the \cs{blclink}\{Pythagorean
51 \par Theorem\}, we have
52 \par \cs{begin}\{align*\}
53 \par\indent\indent \cs{left}|\cs{left}| \cs{sum}\_\{k=1\}\^{}\{m+1\} a\_k \cs{bm} e\_k \cs{right}|\cs{right}|\^{}2
54 \par\indent\indent = \cs{left}|\cs{left}| \cs{sum}\_\{k=1\}\^{}m a\_k \cs{bm} e\_k \cs{right}|\cs{right}|\^{}2
55 \par\indent\indent + \cs{left}|\cs{left}| a\_\{m+1\} \cs{bm} e\_\{m+1\} \cs{right}|\cs{right}|\^{}2
56 \par\indent\indent = \cs{sum}\_\{k=1\}\^{}m | a\_k |\^{}2 + | a\_\{m+1\} |\^{}2
57 \par\indent\indent = \cs{sum}\_\{k=1\}\^{}\{m+1\} | a\_k |\^{}2 \cs{ }.
58 \par \cs{end}\{align*\}
59 \par Thus, the proposition holds for \$n=m+1\$ , and consequently, it holds for all
60 \par positive integers \$n\$ .
61 \par\noindent \}
62 }
63
64 \AutomaticListon
65
66 When creating a block, please ensure that this block type has already been declared via the \cs{NewBlockType} command. The label of a regular block serves as the unique identifier for cross-referencing and cannot duplicate that of other blocks. You can use the following command to quickly create an anonymous block under a regular block type:
67
68 \UserCommand{Quickly Create Anonymous Block}<\cs{\meta{regular block type}}*>{
69 \cs{\meta{regular block type}}*
70 \{\meta{label}\}
71 (\meta{display name})
72 <\meta{parameter}>
73 \{\meta{content}\longarg\}
74 }
75
76 If the \meta{content} is redundant for a specific block type, you can write macros in the preamble to wrap the block creation command. This allows you to omit the content argument when creating the block. The following example demonstrates a simplified command for creating a \texttt{MyBlockType} block:
77
78 \Example{Omitting Block Content-Example}{
79 \par\noindent \cs{NewBlockType} \{MyBlockType\}
80 \par\noindent \cs{NewDocumentCommand} \cs{myblocktype} \{m d() d<>\} \{
81 \par \cs{MyBlockType} \{\#1\} (\#2) <\#3> \{\}
82 \par\noindent \}
83 }
84
85 A similar wrapping technique can also be employed for the synchronized creation of sub-blocks. Please refer to the following example:
86
87 \Example{Synchronizing Sub-Blocks Creation-Example}{
88 \par\noindent \cs{NewDocumentCommand} \cs{TheoremWithProof} \{m +m +d[] +d[]\} \{
89 \par \cs{ParentBlockType} \{\#1-parent\} (\#1) \{\#2\}
90 \par \cs{IfVauleT} \{\#3\} \{
91 \par\indent\indent \cs{Proof} \{\#1-proofA\} (\#1) \{\#3\}
92 \par \}
93 \par \cs{IfVauleT} \{\#4\} \{
94 \par\indent\indent \cs{Proof} \{\#1-proofB\} (\#1) \{\#4\}
95 \par \}
96 \par\noindent \}
97 }
98
99 To easily distinguish between the block types themselves and your wrapped macros, we recommend using words with capitalized first letters (PascalCase) for block type names, and words starting with a lowercase letter (camelCase) to name your wrapper commands.
100
101 \newpage