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

« back to all changes in this revision

Viewing changes to texmf/tex/generic/tex4ht/hyperref.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
% hyperref.4ht                          2005-03-27-10:43 %
 
3
% Copyright (C) 1999--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
\csname end:hyperref\endcsname
 
30
\expandafter\ifx \csname ifHy@texht\endcsname\relax
 
31
   \expand:after{\expandafter
 
32
      \let \csname ifHy@texht\endcsname}\csname ifhy@texht\endcsname
 
33
\fi
 
34
\expandafter\ifx \csname ifHy@texht\endcsname\relax
 
35
   \expand:after{\expandafter
 
36
      \let \csname ifHy@texht\endcsname}\csname iffalse\endcsname
 
37
\fi
 
38
\ifHy@texht \else
 
39
    \:warning{tex4ht loaded after hyperref}
 
40
    \csname Hy@texhttrue\endcsname
 
41
\fi
 
42
 
 
43
\expandafter\ifx \csname ifhy@texht\endcsname\relax
 
44
    \ifx \pdf@bbox\:UnDef
 
45
       \pend:defIII\@setref{\edef\RefArg{##3}}
 
46
\append:defIII\@setref{\let\:autoref\:gobble}
 
47
\AtBeginDocument{%
 
48
   \edef\autoref{\noexpand\protect\expandafter\noexpand
 
49
   \csname autoref \endcsname}}
 
50
\long\expandafter\def\csname autoref \endcsname#1{\expandafter
 
51
    \auto@setref \csname r@#1\endcsname \@firstoffive {#1}}
 
52
\def\auto@setref#1#2#3{\@safe@activestrue
 
53
   \let\:autoref\::autoref
 
54
\T@ref{#3}\@safe@activesfalse}
 
55
\ifx\@refstar\:UnDef
 
56
  \def\@refstar{\let\:autoref\:gobble
 
57
\T@ref}
 
58
\fi
 
59
\let\:autoref\:gobble
 
60
 
 
61
 
 
62
    \else
 
63
       \let\:temp\real@setref
 
64
\let\real@setref\ref
 
65
\let\ref\o:ref
 
66
\let\o:ref\:temp
 
67
 
 
68
\let\end:hyperref\endinput
 
69
\pend:defIII\@setref{\edef\RefArg{##3}}
 
70
\append:defIII\@setref{\let\:autoref\:gobble
 
71
}
 
72
 
 
73
    \fi
 
74
\else
 
75
    \ifx \real@setref\:UnDef \else \let\o:ref\real@setref  \fi
 
76
\let\r:ref\ref
 
77
\def\:refstar#1{\r:ref}
 
78
\def\real@setref{\@ifnextchar*{\:refstar}{\r:ref}}
 
79
\DeclareRobustCommand\ref{\@ifnextchar*{\@refstar}{\real@setref}}
 
80
\def\@refstar{\real@setref}
 
81
\def\@pagerefstar#1{%
 
82
  \@safe@activestrue
 
83
  \expandafter\@setref\csname r@#1\endcsname \@secondoftwo{#1}%
 
84
  \@safe@activesfalse
 
85
}
 
86
\expandafter\pend:defI\csname autoref \endcsname{%
 
87
   \let\:autoref\::autoref \edef\RefArg{##1}}
 
88
\expandafter\append:defI\csname autoref \endcsname{%
 
89
   \let\:autoref\:gobble}
 
90
 
 
91
\fi
 
92
\expandafter\ifx \csname H@item\endcsname\relax
 
93
   \def\:temp{dvi}\ifx \XR@ext\:temp \else
 
94
     \def\:temp{html}\ifx \XR@ext\:temp \else
 
95
         \:warning{\string\usepackage[...]{hyperref} assumes `\XR@ext'
 
96
              option, not `tex4ht'}
 
97
   \fi\fi
 
98
\else
 
99
      \:warning{\string\usepackage[...]{hyperref} assumes `\XR@ext'
 
100
           option, not `tex4ht'}
 
101
\fi
 
102
 
 
103
\ifx \@@wrindex\:UnDef \else
 
104
   \def\@@wrindex#1|#2|#3\\{%
 
105
     \protected@write\@indexfile{}{\string\indexentry{#1}{\thepage}}%
 
106
     \endgroup \@esphack
 
107
   }
 
108
\fi
 
109
\ifx \HyInd@@wrindex\:UnDef \else
 
110
   \def\HyInd@@wrindex#1#2|#3|#4\\{\HyInd@org@wrindex{#1}{#2}}%
 
111
\fi
 
112
\ifx \Hy@RestoreLastskip\:UnDef
 
113
   \let\Hy@RestoreLastskip\relax
 
114
\fi
 
115
\def\prf:label{{}{}{}}%
 
116
\def\hyperlink#1#2{\Link{#1}{}#2\EndLink}
 
117
\def\hypertarget#1#2{\Link{}{#1}#2\EndLink}
 
118
\ifx \hyperpage\:UnDef  \let\hyperpage=\empty  \fi
 
119
\pend:defII\setkeys{%
 
120
   \expandafter\ifx \csname ##1:keys\endcsname\relax
 
121
          \expandafter\def\csname ##1:keys\endcsname{##2}%
 
122
   \else  \expandafter\append:def\csname ##1:keys\endcsname{##2}%
 
123
   \fi  }
 
124
\def\:choices#1,#2//#3#4{%
 
125
   \def\AttributeVal{#1}#3\AttributeVal#4%
 
126
   \def\:temp{#2}\ifx \:temp\empty \else
 
127
   \def\:temp{\:choices#2//{#3}{#4}}\expandafter\:temp\fi}
 
128
\def\check:args#1=#2//{\def\:temp{#2}}
 
129
\def\arg:quote#1=#2//{%
 
130
   \del:sp#1//%
 
131
   \expandafter\ifx \csname a:\:form:attr ::\nosp:arg\endcsname\relax
 
132
      \expandafter\ifx \csname a:::\nosp:arg\endcsname\relax
 
133
            \:warning{No configuration for \:form:attr ::\nosp:arg}%
 
134
      \else \def\AttributeVal{#2}\csname a:::\nosp:arg\endcsname
 
135
      \fi
 
136
   \else
 
137
      \def\AttributeVal{#2}\csname a:\:form:attr ::\nosp:arg\endcsname
 
138
   \fi
 
139
   }
 
140
\def\del:sp#1#2//{\def\nosp:arg{#1#2}}
 
141
\def\:form:attr{\ifx\:textarea\empty
 
142
   \default:textarea\else \:textarea\fi}
 
143
\def\scan:args#1{\let\Attributes=\empty \let\:textarea=\empty
 
144
   \expandafter\ifx \csname #1:keys\endcsname\relax
 
145
      \expandafter\scan:arg
 
146
   \else  \expand:after{\expand:after
 
147
      {\expandafter\scan:arg}\csname #1:keys\endcsname,}\fi
 
148
}
 
149
\def\scan:arg#1,#2//{%
 
150
   \def\:temp{#1}\ifx \:temp\empty\else \ifx \:temp\space\else
 
151
      \check:args#1=//%
 
152
      \ifx \:temp\empty
 
153
         \edef\:textarea{\ifx \:textarea\empty\else ,\fi #1}%
 
154
      \else
 
155
         \arg:quote#1//%
 
156
   \fi\fi\fi
 
157
   \def\:temp{#2}\ifx \:temp\empty \else
 
158
   \def\:temp{\scan:arg#2//}\expandafter\:temp\fi
 
159
}
 
160
\def\check:type#1{\:Optionfalse
 
161
   \def\:temp{#1}\expandafter\check:t\:textarea,//}%
 
162
\def\check:t#1,#2//{\def\:tempa{#1}\ifx \:temp\:tempa \:Optiontrue
 
163
   \else
 
164
       \def\:tempa{#2}\ifx\:tempa\empty\else \def\:tempa{\check:t#2//}\fi
 
165
       \expandafter\:tempa
 
166
   \fi}
 
167
 
 
168
\def\hyper@natlinkend{%
 
169
  \hyper@linkend
 
170
}
 
171
\def\hyper@linkurl#1#2{%
 
172
  \leavevmode  \begingroup    \hyper@chars
 
173
   \ifx \hyper:normalise\:UnDef
 
174
      \Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink
 
175
    \else
 
176
      \Link[#2]{}{}\Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink\EndLink
 
177
      \global\let\hyper:normalise\:UnDef
 
178
    \fi
 
179
  \endgroup }
 
180
\AtBeginDocument{%
 
181
  \pend:defI\hyper@normalise{\let\hyper:normalise\def}%
 
182
  \pend:defI\T@ref{\edef\RefArg{##1}}}
 
183
\def\label@hyperref[#1]#2{{%
 
184
   \def\hyperrefLabel{#2}%
 
185
   \Configure{ref}
 
186
     {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}
 
187
\def\@@hyperref#1#2#3{\Link[#2]{}{}#1\EndLink}
 
188
\expandafter\ifx \csname sectionautorefname\endcsname\relax
 
189
   \let\:temp=\def
 
190
   \def\def#1{\expandafter
 
191
     \ifx \csname \expandafter\:gobble\string#1\endcsname\relax
 
192
         \expandafter\:temp\expandafter#1\else
 
193
      \expandafter\:gobble\fi }
 
194
   \csname Hy@captionsenglish\endcsname
 
195
   \let\def=\:temp
 
196
\fi
 
197
\def\::autoref#1{%
 
198
  \expandafter\ifx \csname  #1autorefname\endcsname \relax
 
199
     \expandafter \ifx \csname #1name\endcsname \relax
 
200
     \else   \csname #1name\endcsname~\fi
 
201
  \else    \csname #1autorefname\endcsname~\fi}
 
202
\let\:autoref\:gobble
 
203
 
 
204
\ifx \H@equation\:UnDef \else
 
205
   \let\o:equation:\H@equation
 
206
\fi
 
207
\ifx \H@endequation\:UnDef \else
 
208
   \let\o:endequation:\H@endequation
 
209
\fi
 
210
\ifx \H@eqnarray\:UnDef \else
 
211
   \let\o:eqnarray:\H@eqnarray
 
212
\fi
 
213
\ifx \H@endsubeqnarray\:UnDef \else
 
214
   \let\o:endsubeqnarray:\H@endsubeqnarray
 
215
\fi
 
216
\ifx \H@subeqnarray\:UnDef \else
 
217
   \let\o:subeqnarray:\H@subeqnarray
 
218
\fi
 
219
\ifx \H@endsubeqnarray\:UnDef \else
 
220
   \let\o:endsubeqnarray:\H@endsubeqnarray
 
221
\fi
 
222
 
 
223
\@ifpackageloaded{subfigure}{%
 
224
  \@ifundefined{sub@label}{}{%
 
225
      \RequirePackage{nameref}%
 
226
}}{}
 
227
\Configure{newlabel}
 
228
   {\cur:th \:currentlabel}
 
229
   {\string\csname\space
 
230
    :autoref\string\endcsname {\@currentlabelname}#1}
 
231
\ifx \@currentlabelname\:UnDef
 
232
   \let\@currentlabelname\empty
 
233
\fi
 
234
\append:defI\refstepcounter{\def\@currentlabelname{#1}}
 
235
\pend:def\eqnarray{\def\@currentlabelname{equation}}
 
236
\pend:def\equation{\def\@currentlabelname{equation}}
 
237
\ifx \figure\:UnDef \else
 
238
  \pend:def\figure{\def\@currentlabelname{figure}}
 
239
  \expandafter\pend:def\csname
 
240
     figure*\endcsname{\def\@currentlabelname{figure}}
 
241
\fi
 
242
\pend:defII\:thm{\def\@currentlabelname{##1}}
 
243
\ifx \part\:UnDef \else
 
244
   \def\:temp#1->#2//{#1}
 
245
   \def\:tempc#1{}
 
246
   \edef\:tempc{\expandafter\:temp\meaning\:tempc//}
 
247
   \edef\:temp{\expandafter\:temp\meaning\part//}
 
248
   \ifx \:temp\:tempc
 
249
      \pend:defI\part{\def\@currentlabelname{part}}
 
250
\fi\fi
 
251
\ifx \chapter\:UnDef \else
 
252
   \let\NR:chapter\@chapter
 
253
   \def\@chapter[#1]#2{%
 
254
     \gHAdvance\:mpNum by 1
 
255
\HAssign\minipageNum=\:mpNum \relax
 
256
%
 
257
     \def\@currentlabelname{\ch:autorefname}%
 
258
     \NR:chapter[{#1}]{#2}%
 
259
   }
 
260
   \let\NR:schapter\@schapter
 
261
   \def\@schapter#1{%
 
262
     \gdef\@currentlabelname{}%
 
263
     \NR:schapter{#1}%
 
264
   }
 
265
   \def\ch:autorefname{chapter}
 
266
   \let\hy:appendix\appendix
 
267
   \def\appendix{\def\ch:autorefname{appendix}\hy:appendix}
 
268
\fi
 
269
\let\NR:sect\no@sect
 
270
\def\no@sect#1#2#3#4#5#6[#7]#8{%
 
271
  \xdef\@currentlabelname{\ifnum #2>\c@secnumdepth\else #1\fi}%
 
272
  \NR:sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
 
273
}
 
274
\let\NR:ssect\no@ssect
 
275
\def\no@ssect#1#2#3#4#5{%
 
276
  \gdef\@currentlabelname{}%
 
277
  \NR:ssect{#1}{#2}{#3}{#4}{#5}%
 
278
}
 
279
 
 
280
\ifx \Hy@linkfileprefix\empty\else
 
281
   \:warning{\noexpand\href of hyperref.sty introduces the prefix
 
282
             `\Hy@linkfileprefix' to prefix-free references.
 
283
             The command \string\hyperlinkfileprefix{...}
 
284
             may be used for changing the prefix (probably
 
285
             \string\hyperlinkfileprefix{}).}
 
286
\fi
 
287
\def\hyper@linkfile#1#2#3{\Link[#2]{#3}{}#1\EndLink}
 
288
\def\phantomsection{%
 
289
 \Hy@GlobalStepCount\Hy@linkcounter
 
290
 \xdef\@currentHref{likesection.\the\Hy@linkcounter}%
 
291
 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
 
292
}
 
293
\catcode`\:=12
 
294
\def\@hyper@readexternallink#1#2#3#4:#5:#6\\#7{%
 
295
      \hyper@linkurl{#3}{#7\ifx\\#2\\\else\##2\fi}}
 
296
\catcode`\:=11
 
297
\def\@Form[#1]{%
 
298
   \def\default:textarea{Form}%
 
299
   \scan:args{}#1,//\a:Form }
 
300
                                        \def\@endForm{\b:Form}
 
301
                                         \NewConfigure{Form}{2}
 
302
\def\@TextField[#1]#2{%
 
303
   \def\default:textarea{TextField}%
 
304
   \scan:args{Field}#1,//%
 
305
   \csname a:TextField::\:textarea\endcsname  \leavevmode#2%
 
306
   \csname b:TextField::\:textarea\endcsname  }
 
307
\def\@PushButton[#1]#2{%
 
308
   \def\default:textarea{PushButton}%
 
309
   \scan:args{}#1,value=#2,//%
 
310
   \csname a:PushButton::\:textarea\endcsname }
 
311
\def\@Reset[#1]#2{%
 
312
   \def\default:textarea{Reset}%
 
313
   \scan:args{}#1,value=#2,//%
 
314
   \csname a:Reset::\:textarea\endcsname }
 
315
\def\@Submit[#1]#2{%
 
316
   \def\default:textarea{Submit}%
 
317
   \scan:args{}#1,value=#2,//%
 
318
   \csname a:Submit::\:textarea\endcsname }
 
319
\def\@CheckBox[#1]#2{%
 
320
   \def\default:textarea{CheckBox}%
 
321
   \scan:args{}#1,//%
 
322
   \csname a:CheckBox::\:textarea\endcsname
 
323
   #2\csname b:CheckBox::\:textarea\endcsname}
 
324
\def\@ChoiceMenu[#1]#2#3{%
 
325
   \def\default:textarea{ChoiceMenu}%
 
326
   \scan:args{}#1,//%
 
327
   \csname a:ChoiceMenu::\:textarea\endcsname  \leavevmode#2%
 
328
   \csname b:ChoiceMenu::\:textarea\endcsname
 
329
   \:choices  #3,//{\csname d:ChoiceMenu::\:textarea\endcsname}%
 
330
         {\csname e:ChoiceMenu::\:textarea\endcsname}%
 
331
   \csname c:ChoiceMenu::\:textarea\endcsname }
 
332
 
 
333
\def\hyper@linkstart#1#2{%
 
334
  \Hy@colorlink{\csname @#1color\endcsname}%
 
335
  \def\Hy@tempa{#1}%
 
336
  \ifx\Hy@tempa\@urltype
 
337
    \Link[#2]{}{}%
 
338
  \else
 
339
    {\hyper@chars\ifx\rel:hyper\def\Link{#2}{}\else\Link[\##2]{}{}\fi}%
 
340
  \fi  \global\let\rel:hyper=\:UnDef
 
341
}
 
342
\def\hyper@linkend{%
 
343
  \EndLink
 
344
  \Hy@endcolorlink
 
345
}
 
346
\def\hyper@anchorstart#1{%
 
347
  \Hy@SaveLastskip
 
348
  \begingroup
 
349
    \hyper@chars\Link{}{#1}%
 
350
  \endgroup
 
351
  \Hy@activeanchortrue
 
352
}
 
353
\def\hyper@anchorend{%
 
354
  \EndLink
 
355
  \Hy@activeanchorfalse
 
356
  \Hy@RestoreLastskip
 
357
}
 
358
 
 
359
\expandafter\ifx\csname ifHy@hyperindex\endcsname\relax
 
360
\else \Hy@hyperindexfalse
 
361
\fi
 
362
\Hinput{hyperref}
 
363
\endinput
 
364