Debian Codegraph @

texmf-dist/tex/generic/tex4ht/hyperref.4ht

raw
1 % hyperref.4ht (2025-10-29-12:48), generated from tex4ht-4ht.tex
2 % Copyright 1999-2009 Eitan M. Gurari
3 % Copyright 2009-2025 TeX Users Group
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3c of this license or (at your option) any
8 % later version. The latest version of this license is in
9 % https://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions
11 % of LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status "maintained".
14 %
15 % The Current Maintainer of this work
16 % is the TeX4ht Project <https://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 \immediate\write-1{version 2025-10-29-12:48}
21
22 \csname end:hyperref\endcsname
23
24 \expandafter\ifx \csname ifHy@texht\endcsname\relax
25 \expand:after{\expandafter
26 \let \csname ifHy@texht\endcsname}\csname ifhy@texht\endcsname
27 \fi
28 \expandafter\ifx \csname ifHy@texht\endcsname\relax
29 \expand:after{\expandafter
30 \let \csname ifHy@texht\endcsname}\csname iffalse\endcsname
31 \fi
32 \ifHy@texht \else
33 \:warning{tex4ht loaded after hyperref}
34 \csname Hy@texhttrue\endcsname
35 \fi
36
37 \def\auto@setref#1#2#3{\@safe@activestrue
38 \let\:autoref\::autoref
39 \T@ref{#3}\@safe@activesfalse}
40 \ifx\@refstar\:UnDef
41 \def\@refstar{\let\:autoref\:gobble
42 \T@ref}
43 \fi
44 \def\:temp{\protect \T@ref}
45 \ifx \::ref\:temp
46 \edef\::ref{\noexpand\protect \expandafter\noexpand \csname ::ref \endcsname}
47 \expandafter\def\csname ::ref \endcsname{\@ifstar \@refstar \T@ref}
48 \fi
49 \def\:temp#1{\@safe@activestrue\org@:ref{#1}\@safe@activesfalse}
50 \expandafter\ifx \csname :ref \endcsname\:temp
51 \expandafter\def\csname :ref \endcsname{\@ifnextchar*{\:refstar}{\r:ref}}
52 \def\r:ref#1{\@safe@activestrue\org@:ref{#1}\@safe@activesfalse}
53 \def\:refstar#1{\r:ref}
54 \fi
55
56 \expandafter\ifx \csname real@setref\endcsname\relax
57 \def\@pagerefstar#1{%
58 \HyRef@StarSetRef{#1}\@secondoffive
59 }
60 \def\@namerefstar#1{%
61 \HyRef@StarSetRef{#1}\@thirdoffive
62 }
63 \def\HyRef@StarSetRef#1{%
64 \begingroup
65 \Hy@safe@activestrue
66 \edef\x{#1}%
67 \@onelevel@sanitize\x
68 \edef\x{\endgroup
69 \noexpand\HyRef@@StarSetRef
70 \expandafter\noexpand\csname r@\x\endcsname{\x}%
71 }%
72 \x
73 }
74
75 \def\HyRef@@StarSetRef#1#2#3{%
76 \ifx#1\@undefined
77 \let#1\relax
78 \fi
79 \real@setref#1#3{#2}%
80 }
81 \fi
82 \expandafter\ifx \csname real@setref\endcsname\relax
83 \let\real@setref\@setref
84 \fi
85
86
87
88 \DeclareRobustCommand*{\autoref}{%
89 \@ifstar{\HyRef@autoref\@gobbletwo}{\HyRef@autoref\hyper@@link}%
90 }
91 \def\HyRef@autoref#1#2{%
92 \begingroup
93 \Hy@safe@activestrue
94 \expandafter\HyRef@autosetref\csname r@#2\endcsname{#2}{#1}%
95 \endgroup
96 }
97
98 \DeclareRobustCommand*{\autopageref}{%
99 \@ifstar{%
100 \HyRef@autopagerefname\pageref*%
101 }\HyRef@autopageref
102 }
103 \def\HyRef@autopageref#1{%
104 \hyperref[{#1}]{\HyRef@autopagerefname\pageref*{#1}}%
105 }
106 \def\HyRef@autopagerefname{%
107 \@ifundefined{pageautorefname}{%
108 \@ifundefined{pagename}{%
109 \Hy@Warning{No autoref name for `page'}%
110 }{%
111 \pagename\nobreakspace
112 }%
113 }{%
114 \pageautorefname\nobreakspace
115 }%
116 }
117
118 \def\HyRef@autosetref#1#2#3{% link command, csname, refname
119 \HyRef@ShowKeysRef{#2}%
120 \ifcase 0\ifx#1\relax 1\fi\ifx#1\Hy@varioref@undefined 1\fi\relax
121 \edef\HyRef@thisref{%
122 \expandafter\@fourthoffive#1\@empty\@empty\@empty
123 }%
124 \expandafter\HyRef@testreftype\HyRef@thisref.\\%
125 \Hy@safe@activesfalse
126 #3{%
127 \expandafter\@fifthoffive#1\@empty\@empty\@empty
128 }{%
129 \expandafter\@fourthoffive#1\@empty\@empty\@empty
130 }{%
131 \HyRef@currentHtag
132 \expandafter\@firstoffive#1\@empty\@empty\@empty
133 \null
134 }%
135 \else
136 \protect\G@refundefinedtrue
137 \nfss@text{\reset@font\bfseries ??}%
138 \@latex@warning{%
139 Reference `#2' on page \thepage\space undefined%
140 }%
141 \fi
142 }
143
144 \def\HyRef@testreftype#1.#2\\{%
145 \@ifundefined{#1autorefname}{%
146 \@ifundefined{#1name}{%
147 \HyRef@StripStar#1\\*\\\@nil{#1}%
148 \@ifundefined{\HyRef@name autorefname}{%
149 \@ifundefined{\HyRef@name name}{%
150 \def\HyRef@currentHtag{}%
151 \Hy@Warning{No autoref name for `#1'}%
152 }{%
153 \edef\HyRef@currentHtag{%
154 \expandafter\noexpand\csname\HyRef@name name\endcsname
155 \noexpand~%
156 }%
157 }%
158 }{%
159 \edef\HyRef@currentHtag{%
160 \expandafter\noexpand\csname\HyRef@name autorefname\endcsname
161 \noexpand~%
162 }%
163 }%
164 }{%
165 \edef\HyRef@currentHtag{%
166 \expandafter\noexpand\csname#1name\endcsname
167 \noexpand~%
168 }%
169 }%
170 }{%
171 \edef\HyRef@currentHtag{%
172 \expandafter\noexpand\csname#1autorefname\endcsname
173 \noexpand~%
174 }%
175 }%
176 }
177
178 \def\HyRef@StripStar#1*\\#2\@nil#3{%
179 \def\HyRef@name{#2}%
180 \ifx\HyRef@name\HyRef@CaseStar
181 \def\HyRef@name{#1}%
182 \else
183 \def\HyRef@name{#3}%
184 \fi
185 }
186 \def\HyRef@CaseStar{*\\}
187 \def\HyRef@currentHtag{}
188 \let\HyRef@ShowKeysRef\@gobble
189 \providecommand*\AMSautorefname{\equationautorefname}
190 \providecommand*\Hfootnoteautorefname{\footnoteautorefname}
191 \providecommand*\Itemautorefname{\itemautorefname}
192 \providecommand*\itemautorefname{item}
193 \providecommand*\equationautorefname{Equation}
194 \providecommand*\footnoteautorefname{footnote}
195 \providecommand*\itemautorefname{item}
196 \providecommand*\figureautorefname{Figure}
197 \providecommand*\tableautorefname{Table}
198 \providecommand*\partautorefname{Part}
199 \providecommand*\appendixautorefname{Appendix}
200 \providecommand*\chapterautorefname{chapter}
201 \providecommand*\sectionautorefname{section}
202 \providecommand*\subsectionautorefname{subsection}
203 \providecommand*\subsubsectionautorefname{subsubsection}
204 \providecommand*\paragraphautorefname{paragraph}
205 \providecommand*\subparagraphautorefname{subparagraph}
206 \providecommand*\FancyVerbLineautorefname{line}
207 \providecommand*\theoremautorefname{Theorem}
208 \providecommand*\pageautorefname{page}
209
210 \expandafter\ifx \csname H@item\endcsname\relax
211 \def\:temp{dvi}\ifx \XR@ext\:temp \else
212 \def\:temp{html}\ifx \XR@ext\:temp \else
213 \:warning{\string\usepackage[...]{hyperref} assumes `\XR@ext'
214 option, not `tex4ht'}
215 \fi\fi
216 \else
217 \:warning{\string\usepackage[...]{hyperref} assumes `\XR@ext'
218 option, not `tex4ht'}
219 \fi
220
221 \ifx \@@wrindex\:UnDef \else
222 \def\@@wrindex#1|#2|#3\\{%
223 \protected@write\@indexfile{}{\string\indexentry{#1}{\thepage}}%
224 \endgroup \@esphack
225 }
226 \fi
227 \ifx \HyInd@@wrindex\:UnDef \else
228 \def\HyInd@@wrindex#1#2|#3|#4\\{\HyInd@org@wrindex{#1}{#2}}%
229 \fi
230 \ifx \Hy@RestoreLastskip\:UnDef
231 \let\Hy@RestoreLastskip\relax
232 \fi
233 \def\hyperlink#1#2{\Link{#1}{}#2\EndLink}
234 \def\hypertarget#1#2{\Link{}{#1}\EndLink#2}
235 \ifx \hyperpage\:UnDef \let\hyperpage=\empty \fi
236 \def\:temp#12->#2//{\def\:temp{#2}}
237 \expandafter\:temp\meaning\setkeys2->//
238 \ifx\:temp\empty \else
239 \pend:defII\setkeys{%
240 \expandafter\ifx \csname ##1:keys\endcsname\relax
241 \expandafter\def\csname ##1:keys\endcsname{##2}%
242 \else \expandafter\append:def\csname ##1:keys\endcsname{##2}%
243 \fi }
244 \fi
245 \def\:choices#1,#2//#3#4{%
246 \def\AttributeVal{#1}#3\AttributeVal#4%
247 \def\:temp{#2}\ifx \:temp\empty \else
248 \def\:temp{\:choices#2//{#3}{#4}}\expandafter\:temp\fi}
249 \def\check:args#1=#2//{\def\:temp{#2}}
250 \def\arg:quote#1=#2//{%
251 \del:sp#1//%
252 \expandafter\ifx \csname a:\:form:attr ::\nosp:arg\endcsname\relax
253 \expandafter\ifx \csname a:::\nosp:arg\endcsname\relax
254 \:warning{No configuration for \:form:attr ::\nosp:arg}%
255 \else \def\AttributeVal{#2}\csname a:::\nosp:arg\endcsname
256 \fi
257 \else
258 \def\AttributeVal{#2}\csname a:\:form:attr ::\nosp:arg\endcsname
259 \fi
260 }
261 \def\del:sp#1#2//{\def\nosp:arg{#1#2}}
262 \def\:form:attr{\ifx\:textarea\empty
263 \default:textarea\else \:textarea\fi}
264 \def\scan:args#1{\let\Attributes=\empty \let\:textarea=\empty
265 \expandafter\ifx \csname #1:keys\endcsname\relax
266 \expandafter\scan:arg
267 \else \expand:after{\expand:after
268 {\expandafter\scan:arg}\csname #1:keys\endcsname,}\fi
269 }
270 \def\scan:arg#1,#2//{%
271 \def\:temp{#1}\ifx \:temp\empty\else \ifx \:temp\space\else
272 \check:args#1=//%
273 \ifx \:temp\empty
274 \edef\:textarea{\ifx \:textarea\empty\else ,\fi #1}%
275 \else
276 \arg:quote#1//%
277 \fi\fi\fi
278 \def\:temp{#2}\ifx \:temp\empty \else
279 \def\:temp{\scan:arg#2//}\expandafter\:temp\fi
280 }
281 \def\check:type#1{\:Optionfalse
282 \def\:temp{#1}\expandafter\check:t\:textarea,//}%
283 \def\check:t#1,#2//{\def\:tempa{#1}\ifx \:temp\:tempa \:Optiontrue
284 \else
285 \def\:tempa{#2}\ifx\:tempa\empty\else \def\:tempa{\check:t#2//}\fi
286 \expandafter\:tempa
287 \fi}
288
289 \def\Hy@MakeCurrentHref#1{%
290 \edef\HyperLocalCurrentHref{#1}%
291 \@onelevel@sanitize\HyperLocalCurrentHref
292 \global\let\HyperGlobalCurrentHref\HyperLocalCurrentHref
293 \let\HyperLocalCurrentHref\HyperGlobalCurrentHref
294 \ifHy@localanchorname
295 \let\@currentHref\HyperLocalCurrentHref
296 \else
297 \global\let\@currentHref\HyperGlobalCurrentHref
298 \fi
299 }
300
301 \let\Hy@SectionAnchorHref\@gobble
302 \ifdefined\Hy@SectionHShift\else
303 \newlength\Hy@SectionHShift
304 \fi
305
306 \def\Hy@MakeCurrentHrefAuto#1{%
307 \Hy@GlobalStepCount\Hy@linkcounter
308 \Hy@MakeCurrentHref{#1.\the\Hy@linkcounter}%
309 }
310
311 \@ifpackageloaded{nameref}{}
312 {%
313 \let\sv:label\label
314 \RequirePackage{nameref}%
315 \let\label\sv:label
316 }
317 \def\hyper@makecurrent#1{%
318 \begingroup
319 \edef\Hy@param{#1}%
320 \ifx\Hy@param\Hy@chapterstring
321 \let\Hy@param\Hy@chapapp
322 \fi
323 \ifHy@hypertexnames
324 \let\@number\@firstofone
325 \@ifundefined{latin@Alph}{}{%
326 \ifx\@Alph\greek@Alph
327 \def\@Alph{Alph\@arabic}%
328 \fi
329 }%
330 \ifHy@naturalnames
331 \let\textlatin\@firstofone
332 \xdef\@currentHlabel{\csname the#1\endcsname}%
333 \else
334 \xdef\@currentHlabel{\csname theH#1\endcsname}%
335 \fi
336 \xdef\@currentHref{%
337 \Hy@param.\expandafter\strip@prefix\meaning\@currentHlabel
338 }%
339 \else
340 \Hy@GlobalStepCount\Hy@linkcounter
341 \xdef\@currentHref{\Hy@param.\the\Hy@linkcounter}%
342 \fi
343 \endgroup
344 }
345 \def\hyper@natlinkend{%
346 \hyper@linkend
347 }
348 \def\hyper@linkurl#1#2{%
349 \leavevmode \begingroup \hyper@chars
350 \ifx \hyper:normalise\:UnDef
351 \expandafter\pend:defI\expandafter\:autoref
352 \expandafter{\HyRef@currentHtag}%
353 \let\HyRef@currentHtag\empty
354 \Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink
355 \else
356 % we use this trick to hide possible ] characters in the URL
357 % https://tex.stackexchange.com/a/707193/2891
358 \def\:currentlink{#2}%
359 \Link[\noexpand\:currentlink]{}{}\Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink\EndLink
360 \global\let\hyper:normalise\:UnDef
361 \fi
362 \endgroup }
363 \AtBeginDocument{%
364 % \pend:defI\hyper@normalise{\let\hyper:normalise\def}%
365 \expandafter\pend:def\csname hyperref
366 \endcsname{\let\hyper:normalise\def}%
367 \expandafter\pend:def\csname href \endcsname{\let\hyper:normalise\def}%
368 \pend:defI\T@ref{\edef\RefArg{##1}}}
369 \def\label@@hyperref#1#2#3{%
370 \ifx#1\relax
371 \protect\G@refundefinedtrue
372 \@latex@warning{%
373 Hyper reference `#2' on page \thepage \space undefined%
374 }%
375 \begingroup
376 \hyperrefundefinedlink{#3}%
377 \endgroup
378 \else%
379 \def\hyperrefLabel{#3}%
380 \begingroup%
381 % Redefine \ref locally to use a third argument as hyperlink text, instead of the referenced counter
382 \Configure{ref}%
383 {\Link}{\EndLink}{\Configure{ref}{}{}{}#3}%
384 \ref{#2}%
385 \endgroup%
386 \fi
387 }
388
389 \Configure{@newlabel}{\@onelevel@sanitize\@currentlabelname}
390 \append:def\protect:wrtoc{\def\ref{\protect\o:ref}}
391
392 \ifx \H@equation\:UnDef \else
393 \let\o:equation:\H@equation
394 \fi
395 \ifx \H@endequation\:UnDef \else
396 \let\o:endequation:\H@endequation
397 \fi
398 \ifx \H@eqnarray\:UnDef \else
399 \let\o:eqnarray:\H@eqnarray
400 \fi
401 \ifx \H@endsubeqnarray\:UnDef \else
402 \let\o:endsubeqnarray:\H@endsubeqnarray
403 \fi
404 \ifx \H@subeqnarray\:UnDef \else
405 \let\o:subeqnarray:\H@subeqnarray
406 \fi
407 \ifx \H@endsubeqnarray\:UnDef \else
408 \let\o:endsubeqnarray:\H@endsubeqnarray
409 \fi
410
411
412 \csname ReadBookmarks\endcsname
413 \@ifundefined{if@skiphyperref}{%
414 \newif\if@skiphyperref
415 }{}
416
417 \ifx \Hy@linkfileprefix\empty\else
418 \:warning{\noexpand\href of hyperref.sty introduces the prefix
419 `\Hy@linkfileprefix' to prefix-free references.
420 The command \string\hyperlinkfileprefix{...}
421 may be used for changing the prefix (probably
422 \string\hyperlinkfileprefix{}).}
423 \fi
424 \def\hyper@linkfile#1#2#3{\Link[#2]{#3}{}#1\EndLink}
425 \def\phantomsection{%
426 \Hy@GlobalStepCount\Hy@linkcounter
427 \xdef\@currentHref{likesection.\the\Hy@linkcounter}%
428 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
429 \edef\@currentlabel{\the\Hy@linkcounter}%
430 \AnchorLabel%
431 }
432 \catcode`\:=12
433 \def\@hyper@readexternallink#1#2#3#4:#5:#6\\#7{%
434 \hyper@linkurl{#3}{#7\ifx\\#2\\\else\##2\fi}}
435 \catcode`\:=11
436 \def\T@pageref#1{%
437 \Hy@safe@activestrue%
438 \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
439 \Hy@safe@activesfalse%
440 }%
441 \def\T@Ref#1{%
442 \Hy@safe@activestrue%
443 \let\olda:rEfLiNK\rEfLiNK%%
444 \def\rEfLiNK##1##2{\Link{##1}{}\edef\:ref:currentlabel{##2}\expandafter\MakeUppercase\:ref:currentlabel\EndLink}%
445 \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
446 \let\rEfLiNK\olda:rEfLiNK%
447 \Hy@safe@activesfalse%
448 }%
449 \def\@Refstar#1{%
450 \Hy@safe@activestrue
451 \let\olda:rEfLiNK\rEfLiNK%%
452 \def\rEfLiNK##1##2{\Link{##1}{}\edef\:ref:currentlabel{##2}\expandafter\MakeUppercase\:ref:currentlabel\EndLink}%
453 \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
454 \let\rEfLiNK\olda:rEfLiNK%
455 \Hy@safe@activesfalse
456 }%
457
458 \def\Hy@PageAnchorSlidesPlain{}%
459 \def\Hy@PageAnchorSlide{}%
460 \def\Hy@appendixstring{appendix}
461 \Configure{writetoc}{\def\texorpdfstring{\@secondoftwo}}
462 \def\@Form[#1]{%
463 \def\default:textarea{Form}%
464 \scan:args{}#1,//\a:Form }
465 \def\@endForm{\b:Form}
466 \NewConfigure{Form}{2}
467 \def\@TextField[#1]#2{%
468 \def\default:textarea{TextField}%
469 \scan:args{Field}#1,//%
470 \csname a:TextField::\:textarea\endcsname \leavevmode#2%
471 \csname b:TextField::\:textarea\endcsname }
472 \def\@PushButton[#1]#2{%
473 \def\default:textarea{PushButton}%
474 \scan:args{}#1,value=#2,//%
475 \csname a:PushButton::\:textarea\endcsname }
476 \def\@Reset[#1]#2{%
477 \def\default:textarea{Reset}%
478 \scan:args{}#1,value=#2,//%
479 \csname a:Reset::\:textarea\endcsname }
480 \def\@Submit[#1]#2{%
481 \def\default:textarea{Submit}%
482 \scan:args{}#1,value=#2,//%
483 \csname a:Submit::\:textarea\endcsname }
484 \def\@CheckBox[#1]#2{%
485 \def\default:textarea{CheckBox}%
486 \scan:args{}#1,//%
487 \csname a:CheckBox::\:textarea\endcsname
488 #2\csname b:CheckBox::\:textarea\endcsname}
489 \def\@ChoiceMenu[#1]#2#3{%
490 \def\default:textarea{ChoiceMenu}%
491 \scan:args{}#1,//%
492 \csname a:ChoiceMenu::\:textarea\endcsname \leavevmode#2%
493 \csname b:ChoiceMenu::\:textarea\endcsname
494 \:choices #3,//{\csname d:ChoiceMenu::\:textarea\endcsname}%
495 {\csname e:ChoiceMenu::\:textarea\endcsname}%
496 \csname c:ChoiceMenu::\:textarea\endcsname }
497
498 \def\hyper@linkstart#1#2{%
499 \expandafter\Hy@colorlink\expandafter{\csname @#1color\endcsname}%
500 \def\Hy@tempa{#1}%
501 \ifx\Hy@tempa\@urltype
502 \Link[#2]{}{}%
503 \else
504 {\hyper@chars\ifx\rel:hyper\def\Link{#2}{}\else\Link[\##2]{}{}\fi}%
505 \fi \global\let\rel:hyper=\:UnDef
506 }
507 \def\hyper@linkend{%
508 \EndLink
509 \Hy@endcolorlink
510 }
511 \def\hyper@anchorstart#1{%
512 \Hy@SaveLastskip
513 \begingroup
514 \hyper@chars\Link{}{#1}%
515 \endgroup
516 \Hy@activeanchortrue
517 }
518 \def\hyper@anchorend{%
519 \EndLink
520 \Hy@activeanchorfalse
521 \Hy@RestoreLastskip
522 }
523 \def\hyper@anchor#1{\hyper@anchorstart{#1}\hyper@anchorend}
524
525 \expandafter\ifx\csname ifHy@hyperindex\endcsname\relax
526 \else \Hy@hyperindexfalse
527 \fi
528 \Hinput{hyperref}
529 \endinput
530