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
% flm.latex.def.flmx.toc -- the table of contents.
%
% FLM builds the table of contents itself; nothing of LaTeX's own
% table-of-contents machinery is used. It is a block of role flm.toc and kind
% token toc holding nested lists of kind tokens unnumbered and toc, one item
% per listed heading; an item holds a link of kind toc to the heading, whose
% content is the heading's number in a span of role flm.toc.entry.number, a
% space and the title, then the item's sub-list:
% \begin{flmxBlock}[role=flm.toc, kinds=toc]
% \begin{flmxList}[kinds={unnumbered toc}, depth=1]
% \flmxItem
% \flmxLink[kind=toc, href={\#sec-1}, target=sec-1, shows-target=true]{%
% \flmxSpan[role=flm.toc.entry.number]{1} Introduction}
% \begin{flmxList}[kinds={unnumbered toc}, depth=2] ... \end{flmxList}
% \end{flmxList}
% \end{flmxBlock}
% A heading without an anchor is listed without a link.
%
% Defaults:
% block flm.toc the title \contentsname as an unnumbered heading of
% level 0 (\flmxHeading[level=0, toc=false]), then the
% lists;
% list toc one paragraph per entry, without a marker, indented from
% the left by \flmxTocIndent for each level of depth past
% the first (the list's depth key);
% link toc the title linked to the heading, dots, and the page
% number of the heading, unlinked, flush right:
% \hyperref[flmx:<target>]{#1}\nobreak\dotfill\nobreak
% \pageref*{flmx:<target>};
% span flm.toc.entry.number the number followed by \enspace (the space
% written after the span is dropped).
% A template changes the look with \flmxDefineBlock{flm.toc}{...}{...},
% \flmxDefineList{toc}{...}{...}, \flmxDefineItem{toc}{...},
% \flmxDefineLink{toc}{<code over #1>} (\flmxKey{target} is the heading's
% anchor), \flmxDefineSpan{flm.toc.entry.number}{<code over #1>}, and the
% length \flmxTocIndent (1.5em) with \setlength.
\newlength\flmxTocIndent
\setlength\flmxTocIndent
\ExplSyntaxOn
\flmxDefineBlock
\flmxDefineList
\flmxDefineItem
\flmxDefineLink
\flmxDefineSpan
\ExplSyntaxOff