| 1 |
% This file is public domain. |
| 2 |
% |
| 3 |
% This example document demonstrates the testidx package |
| 4 |
% with inputenc.sty and xindy. You can build this document using: |
| 5 |
% |
| 6 |
% pdflatex sample-idx-utf8 |
| 7 |
% xindy -M sample-idx-utf8 -M texindy -C utf8 -L english -t sample-idx-utf8.ilg sample-idx-utf8.idx |
| 8 |
% pdflatex sample-idx-utf8 |
| 9 |
% |
| 10 |
% If you are using arara, the directives are: |
| 11 |
% |
| 12 |
% arara: pdflatex |
| 13 |
% arara: xindy: {language: english, codepage: utf8, |
| 14 |
% arara: --> modules: [sample-idx-utf8, texindy]} |
| 15 |
% arara: pdflatex |
| 16 |
\documentclass{article} |
| 17 |
|
| 18 |
\usepackage{filecontents} |
| 19 |
\usepackage[T1]{fontenc} |
| 20 |
\usepackage[utf8]{inputenc} |
| 21 |
\usepackage{amssymb} |
| 22 |
\usepackage{makeidx} |
| 23 |
\usepackage |
| 24 |
[ |
| 25 |
%nosanitize,% don't sanitize characters in the dummy entries |
| 26 |
sanitize,% sanitize characters in the dummy entries |
| 27 |
showmarks,% show where the indexing command has been used |
| 28 |
%hidemarks,% hide the visual effects |
| 29 |
%verbose,% show the argument that's being passed to \index |
| 30 |
% warning: will cause overfull lines! |
| 31 |
noverbose% default |
| 32 |
] |
| 33 |
{testidx} |
| 34 |
|
| 35 |
% Create the .xdy file for this example: |
| 36 |
\begin{filecontents*}{\jobname.xdy} |
| 37 |
; list of allowed attributes |
| 38 |
|
| 39 |
(define-attributes (( |
| 40 |
"tstidxencapi" |
| 41 |
"tstidxencapii" |
| 42 |
"tstidxencapiii" |
| 43 |
))) |
| 44 |
|
| 45 |
; define format to use for locations |
| 46 |
|
| 47 |
(markup-locref :open "\tstidxencapi{" |
| 48 |
:close "}" |
| 49 |
:attr "tstidxencapi") |
| 50 |
|
| 51 |
(markup-locref :open "\tstidxencapii{" |
| 52 |
:close "}" |
| 53 |
:attr "tstidxencapii") |
| 54 |
|
| 55 |
(markup-locref :open "\tstidxencapiii{" |
| 56 |
:close "}" |
| 57 |
:attr "tstidxencapiii") |
| 58 |
|
| 59 |
(markup-locref-list :sep ",") |
| 60 |
(markup-range :sep "--") |
| 61 |
|
| 62 |
; define a numbers group |
| 63 |
|
| 64 |
(define-letter-group "Numbers" |
| 65 |
:prefixes ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9") |
| 66 |
:before "A") |
| 67 |
|
| 68 |
; define a "Maths" group for keys starting with ">" |
| 69 |
|
| 70 |
(define-letter-group "Maths" |
| 71 |
:prefixes (">" ) |
| 72 |
:before "Numbers") |
| 73 |
|
| 74 |
; define a "Markers" group for keys starting with "<" |
| 75 |
|
| 76 |
(define-letter-group "Markers" |
| 77 |
:prefixes ("<" ) |
| 78 |
:before "Maths") |
| 79 |
\end{filecontents*} |
| 80 |
|
| 81 |
\makeindex |
| 82 |
|
| 83 |
\begin{document} |
| 84 |
\testidx |
| 85 |
|
| 86 |
\printindex |
| 87 |
\end{document} |
| 88 |
|