summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/strc-ini.mkvi
blob: 8488d1dab86dea156b525c2408e2f082de15fd19 (plain)
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
83
84
85
86
87
88
89
%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 \& \CONTEXT\ Development Team}]
%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\defineresetset     {\dotripleempty\strc_sets_define_reset_set}
\unexpanded\def\defineseparatorset {\dotripleempty\strc_sets_define_separator_set}
\unexpanded\def\defineconversionset{\dotripleempty\strc_sets_define_conversion_set}
\unexpanded\def\defineprefixset    {\dotripleempty\strc_sets_define_prefix_set}

% Low level versions (no optional checking). The detokenize and escaping might go away.

\unexpanded\def\strc_sets_define_reset_set     [#name][#set][#default]{\ctxcommand{definestructureset("structure:resets",     "#name","\luaescapestring{\detokenize{#set}}","\luaescapestring{\detokenize{#default}}",true)}}
\unexpanded\def\strc_sets_define_separator_set [#name][#set][#default]{\ctxcommand{definestructureset("structure:separators", "#name","\luaescapestring{\detokenize{#set}}","\luaescapestring{\detokenize{#default}}")}}
\unexpanded\def\strc_sets_define_conversion_set[#name][#set][#default]{\ctxcommand{definestructureset("structure:conversions","#name","\luaescapestring{\detokenize{#set}}","\luaescapestring{\detokenize{#default}}")}}
\unexpanded\def\strc_sets_define_prefix_set    [#name][#set][#default]{\ctxcommand{definestructureset("structure:prefixes",   "#name","\luaescapestring{\detokenize{#set}}","\luaescapestring{\detokenize{#default}}")}}

\let\definestructureresetset     \defineresetset
\let\definestructureseparatorset \defineseparatorset
\let\definestructureconversionset\defineconversionset
\let\definestructureprefixset    \defineprefixset

% \defineseparatorset [weird][!,?,*][:]                                  % tex content
% \defineconversionset[weird][numbers,characters,romannumerals][numbers] % symbolic names
% \defineresetset     [weird][0,0,1][0]                                  % numbers

\protect \endinput