~ubuntu-branches/debian/sid/tex4ht/sid

« back to all changes in this revision

Viewing changes to texmf/tex/generic/tex4ht/idxmake.4ht

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2005-04-05 14:14:41 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050405141441-x4dojdgz3frkfyet
Tags: 20050402.1817-1
* New upstream release (2005-04-02-18:17). Closes: #299934.
* See README.src, README.validate, README.Debian and copyright
  for information on minor changes.
* This upload fixes a some .htf files. Closes: #295109.
* Updated the description to reflect recent changes.
* Fixed some typos in src/tex4ht-mkht.tex and consequently
  in the mk4ht script.
* Updated the man page to include mk4ht. 
* Updated the description of options for the scripts in the man page.
  Put more information in the man page about the way the system works.
  Closes: #219348, #219347.
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
2
% idxmake.4ht                          2005-03-27-10:43 %
 
3
% Copyright (C) 2000--2005      Eitan M. Gurari         %
 
4
%                                                        %
 
5
% This work may be distributed and/or modified under the %
 
6
% conditions of the LaTeX Project Public License, either %
 
7
% version 1.3 of this license or (at your option) any    %
 
8
% later version. The latest version of this license is   %
 
9
% in                                                     %
 
10
%   http://www.latex-project.org/lppl.txt                %
 
11
% and version 1.3 or later is part of all distributions  %
 
12
% of LaTeX version 2003/12/01 or later.                  %
 
13
%                                                        %
 
14
% This work has the LPPL maintenance status "maintained".%
 
15
%                                                        %
 
16
% This Current Maintainer of this work                   %
 
17
% is Eitan M. Gurari.                                    %
 
18
%                                                        %
 
19
% If you modify this program your changing its signature %
 
20
% with a directive of the following form will be         %
 
21
% appreciated.                                           %
 
22
%            \message{signature}                         %
 
23
%                                                        %
 
24
%                             gurari@cse.ohio-state.edu  %
 
25
%                 http://www.cse.ohio-state.edu/~gurari  %
 
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
27
\immediate\write-1{version 2005-03-27-10:43}
 
28
 
 
29
 
 
30
\def\SourceInd#1#2#3#4{#1.#2}
 
31
\def\MakefileInd#1#2#3#4{#1.#4}
 
32
 
 
33
\newcount\cnt
 
34
\newtoks\split
 
35
 
 
36
\def\noXcatcodes{%
 
37
   \cnt=0
 
38
   \def\noXXcatcodes{%
 
39
      \catcode\cnt12
 
40
      \ifnum\cnt<255
 
41
          \advance\cnt  1  \expandafter\noXXcatcodes
 
42
      \fi }%
 
43
   \noXXcatcodes }
 
44
 
 
45
\newwrite\idx
 
46
\newwrite\indexes
 
47
\def\MakefileIn#1#2#3#4{#1.#3}
 
48
\def\MakefileIndexes#1#2#3#4{#1.4ix}
 
49
\immediate\openout\idx=\expandafter\MakefileIn\filename\relax
 
50
\immediate\openout\indexes=\expandafter\MakefileIndexes\filename\relax
 
51
 
 
52
\def\beforeentry#1#2#3#4{
 
53
   \def\file{#1}\def\anchor{#2}\def\pointer{#3}
 
54
   \begingroup   \noXcatcodes
 
55
     \catcode`\s=11 \catcode`\e=11 `%for \see`%
 
56
     \catcode`\^^M=10    \catcode`\ =10    \catcode`\^^I=10
 
57
     \catcode`\{=1 \catcode`\}=2 \futurelet\next\preGetentries
 
58
}
 
59
\def\bparent#1|(#2!*?: {\def\core{#1}\def\parent{#2}}
 
60
\def\eparent#1|)#2!*?: {\def\core{#1}\def\parent{#2}}
 
61
\def\see#1|see#2|see#3!*?: {\def\preSee{#1}\def\isSee{#2}}
 
62
\newcount\entryNum
 
63
\def\preGetentries{\ifx [\next \expandafter\opGetentries
 
64
  \else \global\split={}\expandafter\getentries\fi}
 
65
\def\opGetentries[#1]{\global\split={[#1]}\getentries}
 
66
 
 
67
\def\getentries#1#2{\endgroup
 
68
   \advance\entryNum by 1
 
69
   \let\parent=\empty
 
70
   \bparent#1|(!*?: \ifx \parent\empty
 
71
      \eparent#1|)!*?: \ifx \parent\empty
 
72
        \see#1|see|see!*?: %
 
73
\ifx \isSee\empty
 
74
   \hasBar#1|!*?: {#1}{#2}%
 
75
\else
 
76
   \immediate\write\idx{\string \indexentry\the\split{%
 
77
     \preSee|see{\string\LNK{\file}{\anchor}{\isSee}{}}}{\the\entryNum
 
78
}}%
 
79
   \immediate\write\indexes{\string \indexmark\the\split{%
 
80
     \preSee}{\the\entryNum
 
81
}}%
 
82
\fi
 
83
%
 
84
      \else
 
85
        \immediate\write\idx{\string \indexentry\the\split{%
 
86
          \core|LNK\csname \core|(\endcsname
 
87
          --\string\LNK{\file}{\anchor}{\pointer}}{\the\entryNum
 
88
}}%
 
89
        \immediate\write\indexes{\string \indexmark\the\split{%
 
90
          \core}{\the\entryNum
 
91
}}%
 
92
      \fi
 
93
   \else
 
94
      \expandafter\edef\csname \core|(\endcsname
 
95
          {{\file}{\anchor}{\pointer}{\the\entryNum
 
96
}}%
 
97
   \fi
 
98
}
 
99
\def\hasBar#1|#2!*?: #3#4{%
 
100
   \def\temp{#2}\ifx \temp\empty
 
101
      \immediate\write\idx{\string \indexentry\the\split{%
 
102
         #3|LNK{\file}{\anchor}{\pointer}}{\the\entryNum
 
103
}}%
 
104
      \immediate\write\indexes{\string \indexmark\the\split{%
 
105
         #3}{\the\entryNum
 
106
}}%
 
107
   \else \yeshasBar#3!*?: {\the\entryNum
 
108
}\fi
 
109
}
 
110
\def\yeshasBar#1|#2!*?: #3{%
 
111
   \immediate\write\idx{\string \indexentry\the\split{%
 
112
       #1\string\let\string\LNKidx\expandafter\string\csname
 
113
          #2\endcsname|LNK{\file}{\anchor}{\pointer}}{\the\entryNum
 
114
}}%
 
115
   \immediate\write\indexes{\string \indexmark\the\split{%
 
116
       #2}{\the\entryNum
 
117
}}%
 
118
}
 
119
 
 
120
\newcount\GetentriesN
 
121
\GetentriesN=0
 
122
\def\Ganchor{\ifnum \GetentriesN<10 0\fi
 
123
  \ifnum \GetentriesN<100 0\fi
 
124
  \ifnum \GetentriesN<1000 0\fi
 
125
  \the\GetentriesN}
 
126
\def\Beforeentry{\let\getentries=\Getentries
 
127
   \let\Beforeentry=\beforeentry \Beforeentry}
 
128
\def\Getentries#1#2{\endgroup
 
129
   \advance\GetentriesN by 1
 
130
   \let\parent=\empty
 
131
   \bparent#1|(!*?: \ifx \parent\empty
 
132
      \eparent#1|)!*?: \ifx \parent\empty
 
133
        \see#1|see|see!*?: %
 
134
        \ifx \isSee\empty \immediate\write\idx{\string \indexentry\the\split{%
 
135
           \string\indNum{\Ganchor}%
 
136
%
 
137
   #1\string\indNum{\Ganchor}%
 
138
\string\comNum}{#2}}%
 
139
%
 
140
        \else             \immediate\write\idx{\string \indexentry\the\split{%
 
141
   {\Ganchor}%
 
142
   \preSee\string\gobble|see{\isSee}}{#2}}%
 
143
\fi
 
144
      \else
 
145
        \immediate\write\idx{\string \indexentry\the\split{%
 
146
           \string\indNum{\Ganchor}%
 
147
\string\erange{\csname \core|(\endcsname}
 
148
           \core\string\indNum{\Ganchor}%
 
149
\string\comNum}{#2}}%
 
150
      \fi
 
151
   \else
 
152
        \immediate\write\idx{\string \indexentry\the\split{%
 
153
           \string\indNum{\Ganchor}%
 
154
\string\brange{\Ganchor}
 
155
           \core\string\indNum{\Ganchor}%
 
156
\string\comNum}{#2}}%
 
157
        \expandafter\edef\csname \core|(\endcsname{\Ganchor}%
 
158
   \fi
 
159
}
 
160
 
 
161
\input \expandafter\SourceInd\filename\relax
 
162
\immediate\closeout\idx
 
163
\immediate\closeout\indexes
 
164
 
 
165
 
 
166
\bye
 
167
\endinput
 
168