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