summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/eplain/base/test/hlidx.tex
blob: 2d177a9c6d2b2f4bb5acef60a84f6d2cda38e1ed (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
\input ../eplain

% If you uncomment the optional arg, index hyperlinks will point to exact
% locations of terms, but MakeIndex will regard _all_ index entries as distinct.
% This can be partially cured by piping hlidx.idx through `util/idxuniq' script
% before feeding it to MakeIndex (see the first compile-command at the end of
% this file).
\enablehyperlinks%[idxexact]
%\enablehyperlinks[nolinks]
%\enablehyperlinks[pdftex]
%\enablehyperlinks[dvipdfm]

\ifpdf
  \pdfpagewidth=8.5in
  \pdfpageheight=11in
\fi

\beginpackages
  \usepackage{color}
\endpackages

\headline={\hrulefill}

% Try to redefine the delimiters.
\setidxpagelistdelimiter{; }
\setidxpagerangedelimiter{\thinspace--\allowbreak\thinspace}

% Underline and italisize a page number / page range, taking care not to
% underline `--' in page range like `1--3'.
%
% Note that this definition is not enough if you don't use hyperlinks in index
% (i.e., if you pass `idxnone' to \enablehyperlinks).  Then page lists
% like `1, 2' are not broken up by \hlidxpage, and the entire list may
% be passed, which will be be italicized and underlined without being
% split up.  You can see the effect by commenting out
% \enablehyperlinks above.  In that case, you will have to do a more
% sophisticated parsing using both \idxparserange and \idxparselist
% (like in \@hlidxgetpages).
\def\ituline#1{%
  {\it
  \idxparserange{#1}%
  \ifx\idxpagei\empty
    \underbar{#1}%
  \else
    \underbar{\idxpagei}\idxpagerangedelimiter\underbar{\idxpageii}%
  \fi}%
}


\count0=-1

% i
\topglue12pt
% \indent is needed to place hyperlink destination at the beginning of the first
% line of the paragraph instead of vertical mode above the paragraph.
\indent
\sidx[pagemarkup=ituline]{truth}[definition of]
Definition of truth, page~i.

Another
\sidx[pagemarkup=ituline]{truth}[definition of]
definition of truth on page~i.
\vfil\eject

% ii
\topglue24pt
\indent
\sidx[pagemarkup=ituline]{truth}[definition of]
Definition of truth, page~ii.
\vfil\eject

% iii
No index entries, page~iii.
\vfil\eject

\count0=1

% 1
\topglue36pt
\indent
\sidx[pagemarkup=ituline]{truth}[definition of]
Definition of truth, page~1.
\vfil\eject

% 2
\topglue24pt
Beginning of
\sidx[begin,pagemarkup=ituline]{truth}[definition of]
definition of truth, page~2.
\vfil\eject

% 3
\indent
\sidx[pagemarkup=ituline]{truth}[definition of]
Definition of truth that comes whithin an explicit range, page~3.
\vfil\eject

% 4
End of
\sidx[end]{truth}[definition of]
definition of truth, page~4.
\vfil\eject

% 5
\indent\idxname{Adrien-Marie}{Legendre} (September~18, 1752~-- January~10, 1833)
was a French mathematician.

Legendre integrals
\sidx{Legendre\idxnameseparator Adrien-Marie!functions!F(k, phi), E(k,
phi)@$F(k,\varphi)$, $E(k,\varphi)$}
$F(k,\varphi)$ and $E(k,\varphi)$ are called {\it complete\/} when
$\varphi=\pi/2$, in which case they are denoted by
\sidx[pagemarkup=ituline]{Legendre\idxnameseparator Adrien-Marie!functions!K(k),
E(k)@${\bf K}(k)$, ${\bf E}(k)$}
${\bf K}(k)$ and ${\bf E}(k)$.

\indent
\sidx{semantic theory of truth@\leavevmode\hldest{}{}{idx:TSTT}semantic theory of truth}
Semantic theory of truth was developed by Polish logician Alfred Tarski in the
1930s.


\sidx[seealso]{truth}[definition of]{\hlstart{}{}{idx:TSTT}semantic theory of
truth\hlend}


{\baselineskip=36pt
\noindent\bf Index\par}

\hookaction{beginindex}{\singlecolumn}
\readindexfile{i}

\bye

% Local variables:
% compile-command: "(cd .. && make eplain.tex) && rm -f hlidx.aux hlidx.ind hlidx.idx && tex --interact=nonstopmode hlidx && cat hlidx.idx | ../util/idxuniq | makeindex -s hlidx.mst > hlidx.ind && tex --interact=nonstopmode hlidx && dvipdfm -p letter hlidx.dvi"
% compile-command: "(cd .. && make eplain.tex) && rm -f hlidx.aux hlidx.ind hlidx.idx && pdftex --interact=nonstopmode hlidx && makeindex -s hlidx.mst hlidx && pdftex --interact=nonstopmode hlidx"
% End: