summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hvindex/doc/hvindex-doc.tex
blob: 6791ba89c079924fff01a48ec9657c34ae6cc433 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
\listfiles
\documentclass[ngerman]{article}
\usepackage{fontspec}
\usepackage{dejavu-otf}
\usepackage{babel}
\usepackage{longtable}
\usepackage[makeidx]{hvindex}
\usepackage[colorlinks,linktocpage]{hyperref}
\providecommand\phantomsection{}
\title{\texttt{hvindex}, v. \fileversion\\ simplifying indexing \ldots}
\author{Herbert Voß}
\date{\filedate}
\begin{document}
\maketitle

\tableofcontents

\section{Package options}
With the \Index{option} \ttIndex{makeidx} the also called package is 
loaded and the macro \texttt{\textbackslash{}makeindex}
is executed.

The package should be loaded \emph{after} package \ttIndex{babel}.

\section{Introduction}
The \Index{package} \ttIndex{hvindex} defines some \Index{macros}
as a \Index{macro!replacement} for 
\Index{macros!index@\texttt{\textbackslash index}} 
which makes \Index{live} easier\index{easy}. You have to type every
\Index{word} only \Index{once} to get it into the \Index{index} 
and into the \Index{text}.


\small
\begin{verbatim}
The \Index{package} \ttIndex{hvindex} defines some \Index{macros}
as a \Index{macro!replacement} for 
\Index{macros!index@\texttt{\textbackslash index}} 
which makes \Index{live} easier\index{easy}. You have to type every
\Index{word} only \Index{once} to get it into the \Index{index} 
and into the \Index{text}.
\end{verbatim}
\normalsize


\clearpage
\section{The macros}

\begin{longtable}{@{} l  l l @{}}\\\hline
\emph{code} & \emph{Text} & \emph{index}\\\hline
\endfirsthead
\multicolumn{3}{@{}l}{\ldots\ continued from previous page}\\\hline
\emph{code} & \emph{Text} & \emph{index}\\\hline
\endhead
\hline
\multicolumn{3}{r@{}}{continued on next page \ldots}\\
\hline
\endfoot
\hline
\endlastfoot
\verb+\Index{foo}+                      & \Index{foo}                   & foo\\
\verb+\Index{foo!bar}+                  & \Index{foo!bar}               & foo\\
                                        &                                            & \kern1em bar\\
\verb+\Index{foo!bar!baz}+              & \Index{foo!bar!baz}           & foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em baz\\
\verb+\Index{foo@\textsc{foo}}+         & \Index{foo@\textsc{foo}}      & \textsc{foo}\\
\verb+\Index{foo!bar@\textsf{baz}}+     & \Index{foo!bar@\textsf{bar}}  & foo\\
                                        &                                            & \kern1em\textsf{bar}\\
\verb+\Index{foo!bar!baz@\texttt{baz}}+ & \Index{foo!bar!baz@\texttt{baz}}&foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em \texttt{baz}\\
\verb+\Index{foo@\textsc{foo}!bar}+     & \Index{foo@\textsc{foo}!bar}  & \textsc{foo}\\
                                        &                                            & \kern1em bar\\
\verb+\Index{foo!bar@\textsc{bar}!baz}+ & \Index{foo!bar@\textsc{bar}!baz}& foo\\
                                        &                                            & \kern1em\textsc{bar}\\
                                        &                                            & \kern2em baz\\
\verb+\Index{foo@\textsc{foo}}+         & \Index{foo@\textsc{foo}}      & \textsc{foo}\\ 
\verb+\Index{foo!bar@\textsf{baz}}+     & \Index{foo!bar@\textsf{bar}}  & foo\\
                                        &                                            & \kern1em\textsf{bar}\\
\verb+\Index{foo!bar!baz@\texttt{baz}}+ & \Index{foo!bar!baz@\texttt{baz}}& foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em\texttt{baz}\\
\verb+\ttIndex{foo}+                    & \ttIndex{foo} & \texttt{foo}\\
\verb+\bfIndex{foo}+                    & \bfIndex{foo} & \textbf{foo}\\
\verb+\sfIndex{foo}+                    & \sfIndex{foo} & \textsf{foo}\\
\verb+\scIndex{foo}+                    & \scIndex{foo} & \textsc{foo}\\
\verb+\itIndex{foo}+                    & \itIndex{foo} & \textit{foo}\\
\verb+\ttIndex{foo!bar}+                & \ttIndex{foo!bar} & foo\\
                                        &                                            & \kern1em\texttt{bar}\\
\verb+\bfIndex{foo!bar}+                & \bfIndex{foo!bar} & foo\\
                                        &                                            & \kern1em\textbf{bar}\\
\verb+\sfIndex{foo!bar}+                & \sfIndex{foo!bar} & foo\\
                                        &                                            & \kern1em\textsf{bar}\\
\verb+\scIndex{foo!bar}+                & \scIndex{foo!bar} & foo\\
                                        &                                            & \kern1em\textsc{bar}\\
\verb+\itIndex{foo!bar}+                & \itIndex{foo!bar} & foo\\
                                        &                                            & \kern1em\textit{bar}\\
\clearpage
\verb+\ttIndex{foo!bar!baz}+            & \ttIndex{foo!bar!baz} & foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em\texttt{baz}\\
\verb+\bfIndex{foo!bar!baz}+            & \bfIndex{foo!bar!baz} & foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em\textbf{baz}\\
\verb+\sfIndex{foo!bar!baz}+            & \sfIndex{foo!bar!baz} & foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em\textsf{baz}\\
\verb+\scIndex{foo!bar!baz}+            & \scIndex{foo!bar!baz} & foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em\textsc{baz}\\
\verb+\itIndex{foo!bar!baz}+            & \itIndex{foo!bar!baz} & foo\\
                                        &                                            & \kern1em bar\\
                                        &                                            & \kern2em\textit{baz}\\\hline
\verb+\sIndex{foo|bar}+                 & \sIndex{foo|bar}    & foo, see bar \\
\verb+\saIndex{baz|bar}+                & \saIndex{baz|bar}& baz, see also bar\\\hline

\end{longtable}

It is not easy to get the braces into an index, because \verb+\index+ reads its argument \Index{verbatim}.
The package defines the follwong macros:

\verb+\iBraceL+, which writes the \IBraceL{} into the \Index{index}, same for \verb+\iBraceR+ for the right \IBraceR.
With the upper case variant it is writen into the index and also printed into the text,
like this one: \IBraceL\ and \IBraceR\ (\verb|\IBraceL\ and \IBraceR|). The advantage of these macros is, that
the \Index{braces} are sorted correct, the character \IVert{} (written as \verb|\IVert|) must appear between them and it does \ldots

%BTW: with \texttt{hyperref} we have to write \verb+\index{{"|}}+, to get it as a correct \Index{link} into
%the index. \texttt{hvindex} does it for you if you use \verb+\Index{"|}+.
\index{bar}\iVert

\clearpage
\phantomsection
\addcontentsline{toc}{section}{Index}
\printindex
\end{document}