Debian Codegraph @

texmf-dist/doc/latex/testidx/samples/sample-idx-lua.tex

raw
1 % This file is public domain.
2 %
3 % This example document demonstrates the testidx package
4 % with LuaLaTeX and xindy. You can build this document using:
5 %
6 % lualatex sample-idx-lua
7 % xindy -M sample-idx-lua -M texindy -C utf8 -L english -t sample-idx-lua.ilg sample-idx-lua.idx
8 % lualatex sample-idx-lua
9 %
10 % If you are using arara, the directives are:
11 %
12 % arara: lualatex
13 % arara: xindy: {language: english, codepage: utf8,
14 % arara: --> log: sample-idx-lua.ilg,
15 % arara: --> modules: [sample-idx-lua, texindy]}
16 % arara: lualatex
17 \documentclass{article}
18
19 \usepackage{filecontents}
20 \usepackage{fontspec}
21 \usepackage{makeidx}
22 \usepackage{testidx}
23
24 % Create the .xdy file for this example:
25 \begin{filecontents*}{\jobname.xdy}
26 ; list of allowed attributes
27
28 (define-attributes ((
29 "tstidxencapi"
30 "tstidxencapii"
31 "tstidxencapiii"
32 )))
33
34 ; define format to use for locations
35
36 (markup-locref :open "\tstidxencapi{"
37 :close "}"
38 :attr "tstidxencapi")
39
40 (markup-locref :open "\tstidxencapii{"
41 :close "}"
42 :attr "tstidxencapii")
43
44 (markup-locref :open "\tstidxencapiii{"
45 :close "}"
46 :attr "tstidxencapiii")
47
48 (markup-locref-list :sep ",")
49 (markup-range :sep "--")
50
51 ; define a numbers group
52
53 (define-letter-group "Numbers"
54 :prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
55 :before "A")
56
57 ; define a "Maths" group for keys starting with ">"
58
59 (define-letter-group "Maths"
60 :prefixes (">" )
61 :before "Numbers")
62
63 ; define a "Markers" group for keys starting with "<"
64
65 (define-letter-group "Markers"
66 :prefixes ("<" )
67 :before "Maths")
68
69 \end{filecontents*}
70
71 \makeindex
72
73 \begin{document}
74 \testidx
75
76 \printindex
77 \end{document}
78