Debian Codegraph @

texmf-dist/doc/latex/hvindex/hvindex-doc.tex

raw
1 % $Id: hvindex-doc.tex 1063 2025-01-24 15:26:55Z herbert $
2
3 \listfiles
4 \documentclass[english]{article}
5 \usepackage{fontspec}
6 \usepackage{libertinus-otf}
7 \setmonofont{NotoSansMono-Regular.ttf}[FakeStretch=0.85,Scale=MatchLowercase]
8 \usepackage{babel}
9 \usepackage{geometry}
10 \usepackage{longtable}
11 \usepackage[makeidx]{hvindex}
12 \usepackage[colorlinks,linktocpage]{hyperref}
13 \providecommand\phantomsection{}
14 \title{\texttt{hvindex}, v. \fileversion\\ simplifying indexing \ldots}
15 \author{Herbert Voß}
16 \date{\filedate}
17 \begin{document}
18 \maketitle
19
20 \tableofcontents
21
22 \vfill
23 Thanks to:\\
24 Denis Bitouzé
25
26 \clearpage
27 \section{Package options}
28 With the \Index{option} \ttIndex{makeidx} the also called package is
29 loaded and the macro \texttt{\textbackslash{}makeindex}
30 is executed.
31
32 The package should be loaded \emph{after} package \ttIndex{babel}.
33
34 \section{Introduction}
35 The \Index{package} \ttIndex{hvindex} defines some \Index{macros}
36 as a \Index{macro!replacement} for
37 \Index{macros!index@\texttt{\textbackslash index}}
38 which makes \Index{live} easier\index{easy}. You have to type every
39 \Index{word} only \Index{once} to get it into the \Index{index}
40 and into the \Index{text}.
41
42
43 \small
44 \begin{verbatim}
45 The \Index{package} \ttIndex{hvindex} defines some \Index{macros}
46 as a \Index{macro!replacement} for
47 \Index{macros!index@\texttt{\textbackslash index}}
48 which makes \Index{live} easier\index{easy}. You have to type every
49 \Index{word} only \Index{once} to get it into the \Index{index}
50 and into the \Index{text}.
51 \end{verbatim}
52 \normalsize
53
54
55 \clearpage
56 \section{The macros}
57
58 \begin{longtable}{@{} l l l @{}}\\\hline
59 \emph{code} & \emph{Text} & \emph{index}\\\hline
60 \endfirsthead
61 \multicolumn{3}{@{}l}{\ldots\ continued from previous page}\\\hline
62 \emph{code} & \emph{Text} & \emph{index}\\\hline
63 \endhead
64 \hline
65 \multicolumn{3}{r@{}}{continued on next page \ldots}\\
66 \hline
67 \endfoot
68 \hline
69 \endlastfoot
70 \verb+\Index{foo}+ & \Index{foo} & foo\\
71 \verb+\Index{foo!bar}+ & \Index{foo!bar} & foo\\
72 & & \kern1em bar\\
73 \verb+\Index{foo!bar!baz}+ & \Index{foo!bar!baz} & foo\\
74 & & \kern1em bar\\
75 & & \kern2em baz\\
76 \verb+\Index{foo@\textsc{foo}}+ & \Index{foo@\textsc{foo}} & \textsc{foo}\\
77 \verb+\Index{foo!bar@\textsf{baz}}+ & \Index{foo!bar@\textsf{bar}} & foo\\
78 & & \kern1em\textsf{bar}\\
79 \verb+\Index{foo!bar!baz@\texttt{baz}}+ & \Index{foo!bar!baz@\texttt{baz}}&foo\\
80 & & \kern1em bar\\
81 & & \kern2em \texttt{baz}\\
82 \verb+\Index{foo@\textsc{foo}!bar}+ & \Index{foo@\textsc{foo}!bar} & \textsc{foo}\\
83 & & \kern1em bar\\
84 \verb+\Index{foo!bar@\textsc{bar}!baz}+ & \Index{foo!bar@\textsc{bar}!baz}& foo\\
85 & & \kern1em\textsc{bar}\\
86 & & \kern2em baz\\
87 \verb+\Index{foo@\textsc{foo}}+ & \Index{foo@\textsc{foo}} & \textsc{foo}\\
88 \verb+\Index{foo!bar@\textsf{baz}}+ & \Index{foo!bar@\textsf{bar}} & foo\\
89 & & \kern1em\textsf{bar}\\
90 \verb+\Index{foo!bar!baz@\texttt{baz}}+ & \Index{foo!bar!baz@\texttt{baz}}& foo\\
91 & & \kern1em bar\\
92 & & \kern2em\texttt{baz}\\
93 \verb+\ttIndex{foo}+ & \ttIndex{foo} & \texttt{foo}\\
94 \verb+\bfIndex{foo}+ & \bfIndex{foo} & \textbf{foo}\\
95 \verb+\sfIndex{foo}+ & \sfIndex{foo} & \textsf{foo}\\
96 \verb+\scIndex{foo}+ & \scIndex{foo} & \textsc{foo}\\
97 \verb+\itIndex{foo}+ & \itIndex{foo} & \textit{foo}\\
98 \verb+\ttIndex{foo!bar}+ & \ttIndex{foo!bar} & foo\\
99 & & \kern1em\texttt{bar}\\
100 \verb+\bfIndex{foo!bar}+ & \bfIndex{foo!bar} & foo\\
101 & & \kern1em\textbf{bar}\\
102 \verb+\sfIndex{foo!bar}+ & \sfIndex{foo!bar} & foo\\
103 & & \kern1em\textsf{bar}\\
104 \verb+\scIndex{foo!bar}+ & \scIndex{foo!bar} & foo\\
105 & & \kern1em\textsc{bar}\\
106 \verb+\itIndex{foo!bar}+ & \itIndex{foo!bar} & foo\\
107 & & \kern1em\textit{bar}\\
108 \clearpage
109 \verb+\ttIndex{foo!bar!baz}+ & \ttIndex{foo!bar!baz} & foo\\
110 & & \kern1em bar\\
111 & & \kern2em\texttt{baz}\\
112 \verb+\bfIndex{foo!bar!baz}+ & \bfIndex{foo!bar!baz} & foo\\
113 & & \kern1em bar\\
114 & & \kern2em\textbf{baz}\\
115 \verb+\sfIndex{foo!bar!baz}+ & \sfIndex{foo!bar!baz} & foo\\
116 & & \kern1em bar\\
117 & & \kern2em\textsf{baz}\\
118 \verb+\scIndex{foo!bar!baz}+ & \scIndex{foo!bar!baz} & foo\\
119 & & \kern1em bar\\
120 & & \kern2em\textsc{baz}\\
121 \verb+\itIndex{foo!bar!baz}+ & \itIndex{foo!bar!baz} & foo\\
122 & & \kern1em bar\\
123 & & \kern2em\textit{baz}\\\hline
124 \verb+\sIndex{foo|bar}+ & \sIndex{foo|bar} & foo, see bar \\
125 \verb+\saIndex{baz|bar}+ & \saIndex{baz|bar}& baz, see also bar\\\hline
126
127 \end{longtable}
128
129 It is not easy to get the braces into an index, because \verb+\index+ reads its argument \Index{verbatim}.
130 The package defines the follwong macros:
131
132 \verb+\iBraceL+, which writes the \IBraceL{} into the \Index{index}, same for \verb+\iBraceR+ for the right \IBraceR.
133 With the upper case variant it is writen into the index and also printed into the text,
134 like this one: \IBraceL\ and \IBraceR\ (\verb|\IBraceL\ and \IBraceR|). The advantage of these macros is, that
135 the \Index{braces} are sorted correct, the character \IVert{} (written as \verb|\IVert|) must appear between them and it does \ldots
136
137 %BTW: with \texttt{hyperref} we have to write \verb+\index{{"|}}+, to get it as a correct \Index{link} into
138 %the index. \texttt{hvindex} does it for you if you use \verb+\Index{"|}+.
139 \index{bar}\iVert
140
141 \clearpage
142 \phantomsection
143 \addcontentsline{toc}{section}{Index}
144 \printindex
145 \end{document}
146
147