summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/luaindex/luaindex-example.ltx
blob: 810d50fe956bd152f8b510f11a27cb0bfc2a9cf2 (plain)
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
%%
%% This is file `luaindex-example.ltx',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% luaindex.dtx  (with options: `example')
%%  
%% Copyright (c) 2011 by Markus Kohm <komascript(at)gmx.info>
%% 
%% This file was generated from file(s) of luaindex distribution.
%% --------------------------------------------------------------
%% 
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, version 1.3c of the license.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later and of this work.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainer and author of this work is Markus Kohm.
%% 
%% This file may only be distributed together with the files listed in
%% `luaindex.dtx'. You may however distribute the files listed in
%% `luaindex.dtx' without this file.
%% 
%% NOTE: THIS IS AN ALPHA-VERSION!
%% 
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesFile{luaindex-example.ltx}
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{fontspec}
\usepackage[
  locale=de_DE,
  singlepass % Wenn der Index ohnehin eine neue Seite produziert,
             % dann kann er direkt beim ersten Lauf ein korrektes
             % Ergebnis liefern.
]{luaindex}
\makeindex
\directlua{koma.luaindex.presortreplace('general',0,
  '\luatexluaescapestring{\string\textbf}\space*\string\{([\string^\string\}]*)\string\}','\%1')}
\begin{document}

\blindtext[10]
A\index{B ist der zweite Buchstabe}
aber\index{aber ist ein Wort}
D\index{D ist der vierte Buchstabe}
A\index{A ist der erste Buchstabe}
A\index{A ist der erste Buchstabe}
C\index{C ist "`der"' dritte Buchstabe}
X\index{X ist der drittletzte Buchstabe}
D\index{\textbf{D} ist der Buchstabe nach C}
Y\index{Y ist der \textbf{vorletzte} Buchstabe}
Z\index{Z ist der letzte Buchstabe}
A\index{Ä ist auch ein Buchstabe}
Ä\index[sort={Ä ist aber auch ein Buchstabe},%
        pageformat=\emph]{Ä ist wirklich auch
  ein Buchstabe (und hier stimmt die Sortierung
  nicht -- \emph{aber eigentlich doch})}
\clearpage

A\index{A ist der erste Buchstabe}
Ae\index{Ae ist kein Buchstabe, sondern zwei}

Kompliziert\subindex{Diverses}{Untereintrag}
Noch komplizierter\subindex{Diverses}{Obereintrag}
Noch komplizierter\%
subindex{Diverses}[sort=Obereintra,pageformat=\emph]{Untereintrag}
Noch komplizierter%
\subsubindex{Diverses}{Untereintrag}{Unteruntereintrag}

\printindex
\end{document}
\endinput
%%
%% End of file `luaindex-example.ltx'.