Debian Codegraph @

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

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