1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Structure Macros Automatic Levels}
15
16
17
18
19
20
21
22\registerctxluafile{strclev}{}
23
24\unprotect
25
26\unexpanded\def\definesectionlevels{\dodoubleargument\strc_levels_define}
27\unexpanded\def\startsectionlevel {\dosingleempty \strc_levels_start_section}
28\unexpanded\def\startsubjectlevel {\dosingleempty \strc_levels_start_subject}
29
30\unexpanded\def\strc_levels_define[#category][#list]{\clf_definesectionlevels{#category}{#list}}
31\unexpanded\def\stopsectionlevel {\clf_stopsectionlevel}
32\unexpanded\def\stopsubjectlevel {\clf_stopsectionlevel}
33
34\unexpanded\def\nostarthead{\dotripleargument\strc_levels_start_nop}
35\unexpanded\def\nostophead {\dosingleargument\strc_levels_stop_nop }
36
37\unexpanded\def\strc_levels_start_section[#category]
38 {\doifelseassignment{#category}
39 {\clf_startsectionlevel\plusone{\v!default}{\currentnamedsection}[#category]}
40 {\clf_startsectionlevel\plusone {#category}{\currentnamedsection}}}
41
42\unexpanded\def\strc_levels_start_subject[#category]
43 {\doifelseassignment{#category}
44 {\clf_startsectionlevel\plustwo{\v!default}{\currentnamedsection}[#category]}
45 {\clf_startsectionlevel\plustwo {#category}{\currentnamedsection}}}
46
47\unexpanded\def\strc_levels_start_nop[#category][#settings][#userdata]
48 {\blank
49 \noindentation{\tttf[start missing section level #category]}
50 \blank}
51
52\unexpanded\def\strc_levels_stop_nop[#category]
53 {\blank
54 \noindentation{\tttf[stop missing section level #category]}
55 \blank}
56
57\definesectionlevels
58 [\v!default]
59 [{\v!chapter,\v!title},
60 {\v!section,\v!subject},
61 {\v!subsection,\v!subsubject},
62 {\v!subsubsection,\v!subsubsubject},
63 {\v!subsubsubsection,\v!subsubsubject},
64 {\v!subsubsubsubsection,\v!subsubsubject}]
65
66\let\definestructurelevels\definesectionlevels
67\let\startstructurelevel \startsectionlevel
68\let\stopstructurelevel \stopsectionlevel
69
70\protect \endinput
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102 |