1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
%D \module
%D [ file=strc-flt,
%D version=2008.10.20,
%D title=\CONTEXT\ Structure Macros,
%D subtitle=Initialization \& Helpers,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright=PRAGMA-ADE / Hans Hagen]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\writestatus{loading}{ConTeXt Structure Macros / Initialization & Helpers}
\registerctxluafile{strc-ini}{1.001}
\unprotect
% segments: 0:100 2:3 chapter:subsection 3 (=self+2) (alternative: sectionset)
% section : [sectionnumber(s)]
% sectionseparatorset (default) sectionconversionset (default) sectionstopper () sectionset sectionsegments
% lists : [sectionnumber(s)] [text] [prefix(es)[separator]][pagenumber(s)]
% sectionseparatorset (default) sectionconversionset (default) sectionstopper sectionset sectionsegments
% prefixseparatorset (default) prefixconversionset (default) prefixstopper (.) prefixset prefixsegments
% pageseparatorset (default) pageconversionset (default) pagestopper () pagesegments
% prefix (no)
% counter : [prefix(es)[separator]][number(s)]
% prefixseparatorset (default) prefixconversionset (default) prefixstopper (.) prefixset prefixsegments
% numberseparatorset (default) numberconversionset (default) numberstopper () numbersegments
% prefix (no)
% pagenumber: [prefix(es)[separator]][pagenumber(s)]
% prefixseparatorset (default) prefixconversionset (default) prefixstopper (.) prefixset prefixsegments
% pageseparatorset (default) pageconversionset (default) pagestopper ()
% prefix (no)
% text mark reference list
% section P P P P
% float P.N P.N P.N
% itemize P.N P.N
% enumerate P.N P.N P.N
% formula P.N P.N
% footnote P.N P.N P.N
% number P.N P.N
% number prefix section page
% [text|marking|reference|list]:[number|prefix|pagenumber|pageprefix]:[separatorset|conversionset|conversion|stopper|set|segments|resetset|order]
% figure caption : text:number:* text:prefix:* -> \setupcaption[figure][...]; stores defaults
% figure list : list:number:* list:prefix:* list:pagenumber:* list:pageprefix:* -> \setuplist[figure][...]; takes stored defaults for number and pagenumber]
% figure reference: reference:number:* reference:prefix:* reference:pagenumber:* reference:pageprefix:* -> \setupreference[figure]]...]; takes stored defaults
% This module deals with structure: section headers, list and
% numbering and eventually cross referencing. These components are
% rather interwoven and therefore an inbetween layer is used.
% Eventually this will replace the corresponding code in core-sec,
% core-lst, core-num and core-ref.
% We collect operations that deal with things like formatting on each
% level of a number in sets. This is all handles at the \LUA\ end.
% References to such sets travel with the multipass information.
\unexpanded\def\definestructureresetset {\dotripleempty\dodefinestructureresetset}
\unexpanded\def\definestructureseparatorset {\dotripleempty\dodefinestructureseparatorset}
\unexpanded\def\definestructureconversionset{\dotripleempty\dodefinestructureconversionset}
\unexpanded\def\definestructureprefixset {\dotripleempty\dodefinestructureprefixset}
\def\dodefinestructureresetset [#1][#2][#3]{\ctxlua{structures.sets.define("structure:resets", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}",true)}}
\def\dodefinestructureseparatorset [#1][#2][#3]{\ctxlua{structures.sets.define("structure:separators", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}")}}
\def\dodefinestructureconversionset[#1][#2][#3]{\ctxlua{structures.sets.define("structure:conversions","#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}")}}
\def\dodefinestructureprefixset [#1][#2][#3]{\ctxlua{structures.sets.define("structure:prefixes", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}")}}
% \definestructureseparatorset [weird][!,?,*][:] % tex content
% \definestructureconversionset[weird][numbers,characters,romannumerals][numbers] % symbolic names
% \definestructureresetset [weird][0,0,1][0] % numbers
\protect \endinput
|