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