diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-20 00:16:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-20 00:16:44 +0000 |
commit | 81e85f9bb5875b6c3cd460112e26e715d8965004 (patch) | |
tree | 080f756dab293c38187e2cc6cde199e717f57433 /Master/texmf-dist/tex/latex/hyperref/hyperref.sty | |
parent | 4cdec44e9893db7879eb9f2f34cfcbe52072abd0 (diff) |
hyperref 6.75a (1aug06)
git-svn-id: svn://tug.org/texlive/trunk@1993 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperref/hyperref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/hyperref/hyperref.sty | 581 |
1 files changed, 418 insertions, 163 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty index a257cd26536..688bfa117cd 100644 --- a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty +++ b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty @@ -7,7 +7,6 @@ %% hyperref.dtx (with options: `package') %% %% File: hyperref.dtx Copyright 1995-2001 Sebastian Rahtz, -%% RCS: $Id: hyperref.dtx 6.71 2000/10/04 rahtz Exp rahtz $ %% %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -24,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{hyperref} - [2003/11/30 v6.74m + [2006/08/16 v6.75c Hypertext links for LaTeX] \begingroup \@makeother\`% @@ -111,6 +110,9 @@ \newif\ifHy@CJKbookmarks \newif\ifHy@colorlinks \newif\ifHy@draft +\let\Hy@finaltrue\Hy@draftfalse +\let\Hy@finalfalse\Hy@drafttrue +\newif\ifHy@escapeform \newif\ifHy@figures \newif\ifHy@fitwindow \newif\ifHy@frenchlinks @@ -146,6 +148,7 @@ \Hy@breaklinksfalse \Hy@centerwindowfalse \Hy@CJKbookmarksfalse +\Hy@escapeformfalse \Hy@figuresfalse \Hy@fitwindowfalse \Hy@hyperfootnotestrue @@ -158,10 +161,10 @@ \Hy@nestingfalse \Hy@newwindowfalse \Hy@pageanchortrue -\Hy@pagelabelsfalse +\Hy@pagelabelstrue \Hy@pdfpagehiddenfalse \Hy@pdfstringfalse -\Hy@plainpagestrue +\Hy@plainpagesfalse \Hy@raiselinksfalse \Hy@setpagesizetrue \Hy@texhtfalse @@ -235,6 +238,7 @@ \edef\8{\string\8}% \edef\9{\string\9}% \fontencoding{PU}% + \HyPsd@UTFviii \else \fontencoding{PD1}% \fi @@ -296,6 +300,7 @@ \let\@safe@activestrue\relax \let\@safe@activesfalse\relax \let\cyr\relax + \let\es@roman\@Roman \let\glqq\textglqq \let\grqq\textgrqq \let\glq\textglq @@ -304,6 +309,7 @@ \let\frqq\textfrqq \let\flq\textflq \let\frq\textfrq + \let\if@mid@expandable\@firstoftwo \HyPSD@AMSclassfix \let\hspace\HyPsd@hspace \let\label\@gobble @@ -333,6 +339,7 @@ \fi }% \let\leavevmode\@empty + \let\mbox\@empty \def\halign{\pdfstringdefWarn\halign\@gobble}% \ifHy@CJKbookmarks \HyPsd@CJKhook @@ -353,6 +360,7 @@ \let\egroup\/% \let\discretionary\@gobbletwo \let\@ifnextchar\HyPsd@ifnextchar + \let\@ifnextchar\HyPsd@new@ifnextchar \let\@protected@testopt\HyPsd@protected@testopt \begingroup \let\GenericError\@gobblefour @@ -761,18 +769,40 @@ \@gobble }% \let#2\let - \def\HyPsd@LetCommand##1{% - #2% - \expandafter\noexpand - \csname\expandafter\@gobble\string##1\@empty\endcsname + \def\HyPsd@@LetCommand##1{% + \expandafter\ifx\csname##1\expandafter\endcsname + \csname iftrue\endcsname + \pdfstringdefWarn\let + \expandafter\@gobble + \else + \expandafter\ifx\csname##1\expandafter\endcsname + \csname iffalse\endcsname + \pdfstringdefWarn\let + \expandafter\expandafter\expandafter\@gobble + \else + #2% + \expandafter\noexpand + \csname##1\expandafter\expandafter\expandafter\endcsname + \fi + \fi }% }% \expandafter\x\csname <def>-command\expandafter\endcsname \csname <let>-command\endcsname +\def\HyPsd@LetCommand#1{% + \expandafter\expandafter\expandafter\HyPsd@@LetCommand + \expandafter\expandafter\expandafter{% + \expandafter\@gobble\string#1\@empty + }% +} \def\HyPsd@ifnextchar{% \pdfstringdefWarn\@ifnextchar \expandafter\@gobbletwo\@gobble } +\def\HyPsd@new@ifnextchar{% + \pdfstringdefWarn\new@ifnextchar + \expandafter\@gobbletwo\@gobble +} \def\HyPsd@protected@testopt#1{% \pdfstringdefWarn#1% \@gobbletwo @@ -1051,9 +1081,15 @@ \catcode`\\=12 |gdef|HyPsd@ConvertToUnicode#1{% |xdef#1{% - \376\377% |expandafter|HyPsd@DoConvert#1|@empty|@empty|@empty }% + |xdef#1{% + |ifx#1|@empty + |else + \376\377% + #1% + |fi + }% } |gdef|HyPsd@DoConvert#1{% |ifx#1|@empty @@ -1097,6 +1133,96 @@ \xdef#4{#4#1#2}% \HyPsd@@ConvertToUnicode#3\END#4% } +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname numexpr\endcsname\relax + \let\HyPsd@UTFviii\relax +\else + \def\HyPsd@UTFviii{% + \let\UTFviii@two@octets\HyPsd@UTFviii@two + \let\UTFviii@three@octets\HyPsd@UTFviii@three + \let\unichar\HyPsd@unichar + }% + \def\HyPsd@UTFviii@two#1#2{% + \expandafter\HyPsd@UTFviii@@two + \number\dimexpr.25\dimexpr`#1sp\expandafter\relax\expandafter|% + \number`#1\expandafter|% + \number\dimexpr.125\dimexpr`#2sp\expandafter\relax\expandafter|% + \number`#2 \@nil + }% + \def\HyPsd@UTFviii@@two#1|#2|#3|#4\@nil{% + \expandafter\8% + \number\numexpr #1-48\expandafter\relax + \csname\number\numexpr #2-4*#1\relax\expandafter\endcsname + \number\numexpr #3-8*% + \number\dimexpr.125\dimexpr#3sp\relax\relax\expandafter\relax + \number\numexpr #4-8*#3\relax + }% + \def\HyPsd@UTFviii@three#1#2#3{% + \expandafter\HyPsd@UTFviii@@three + \number\dimexpr.25\dimexpr`#1sp\expandafter\relax\expandafter|% + \number`#1\expandafter|% + \number\ifnum\numexpr`#2-128\relax <32 0\else 1\fi\expandafter|% + \number\dimexpr.25\dimexpr`#2sp\expandafter\relax\expandafter|% + \number`#2\expandafter|% + \number\dimexpr.125\dimexpr`#3sp\expandafter\relax\expandafter|% + \number`#3 \@nil + }% + \def\HyPsd@UTFviii@@three#1|#2|#3|#4|#5|#6|#7\@nil{% + \expandafter\9% + \number\numexpr #1-56\expandafter\relax + \number\numexpr 2*(#2-4*#1)+#3\expandafter\relax + \number\numexpr #4 - 32 -\ifcase#3 0\else 8\fi\expandafter\relax + \csname\number\numexpr #5-4*#4\relax\expandafter\endcsname + \number\numexpr #6-16\expandafter\relax + \number\numexpr #7-8*#6\relax + }% + \def\HyPsd@UTFviii@four#1{% + \expandafter\HyPsd@UTFviii@@four\number`#1|% + }% + \def\HyPsd@UTFviii@@four#1|#2#3#4{% + \expandafter\HyPsd@UTFviii@@@four\number#1\expandafter|% + \number`#2\expandafter| + \number\dimexpr.03125\dimexpr`#2sp\expandafter|% + \number`#3\expandafter|% + \number\dimexpr.03125\dimexpr`#3sp\expandafter|% + \number`#4\expandafter|% + \number\dimexpr.125\dimexpr`#4|% + }% + \def\HyPsd@UTFviii@@@four#1|#2|#3|#4|#5|#6|#7|{% + \931% + \number\numexpr\dimexpr.5\dimexpr#1sp\relax\relax -120\relax + \csname\number\numexpr\ifodd#1 2\else 0\fi +#3-4\relax\endcsname + \number\dimexpr.25\dimexpr #2sp - 32\dimexpr#3sp\relax\relax\relax + % ... + }% + \def\HyPsd@unichar#1{% + \expandafter\HyPsd@@unichar\string#1\@empty\@empty\@empty\@nil + }% + \def\HyPsd@@unichar #1-#2-#3#4#5#6\@nil{% + \ifnum#2>191 % + \ifnum#2<224 % + \expandafter\HyPsd@UTFviii@@two + \number\dimexpr.25\dimexpr#2sp\expandafter\relax\expandafter|% + \number#2\expandafter|% + \number\dimexpr.125\dimexpr`#3sp\expandafter\relax\expandafter|% + \number`#3 \@nil + \else + \ifnum#2<240 % + \expandafter\HyPsd@UTFviii@@three + \number\dimexpr.25\dimexpr#2sp\expandafter\relax\expandafter|% + \number#2\expandafter|% + \number\ifnum\numexpr`#3-128\relax <32 0\else 1\fi\expandafter|% + \number\dimexpr.25\dimexpr`#3sp\expandafter\relax\expandafter|% + \number`#3\expandafter|% + \number\dimexpr.125\dimexpr`#4sp\expandafter\relax\expandafter|% + \number`#4 \@nil + \else + ?% unsupported + \fi + \fi + \fi + }% +\fi \@ifpackageloaded{subfigure}{% \@ifundefined{sub@label}{% \Hy@hypertexnamesfalse @@ -1104,20 +1230,22 @@ \renewcommand*{\sub@label}[1]{% \@bsphack \subfig@oldlabel{#1}% - \begingroup - \edef\@currentlabstr{% - \expandafter\strip@prefix\meaning\@currentlabelname - }% - \protected@write\@auxout{}{% - \string\newlabel{sub@#1}{% - {\@nameuse{@@thesub\@captype}}% - {\thepage}% - {\expandafter\strip@period\@currentlabstr\relax.\relax\@@@}% - {\@currentHref}% - {}% + \if@filesw + \begingroup + \edef\@currentlabstr{% + \expandafter\strip@prefix\meaning\@currentlabelname }% - }% - \endgroup + \protected@write\@auxout{}{% + \string\newlabel{sub@#1}{% + {\@nameuse{@@thesub\@captype}}% + {\thepage}% + {\expandafter\strip@period\@currentlabstr\relax.\relax\@@@}% + {\@currentHref}% + {}% + }% + }% + \endgroup + \fi \@esphack }% \@ifpackagelater{subfigure}{2002/03/26}{}{% @@ -1152,6 +1280,7 @@ \ifvmode #1% \else + \penalty\@M \smash{\raise\HyperRaiseLinkLength\hbox{#1}}% \fi } @@ -1245,12 +1374,7 @@ \Hy@boolkey{draft}{#1}% } \define@key{Hyp}{final}[true]{% - \Hy@boolkey{draft}{#1}% - \ifHy@draft - \Hy@draftfalse - \else - \Hy@drafttrue - \fi + \Hy@boolkey{final}{#1}% } \let\KV@Hyp@nolinks\KV@Hyp@draft \define@key{Hyp}{a4paper}[true]{% @@ -1340,6 +1464,10 @@ \Hy@breaklinkstrue } \define@key{Hyp}{dvipdf}[true]{% + \Hy@WarningNoLine{% + Option `dvipdf' is deprecated.\MessageBreak + See the user manual for available driver options% + }% } \define@key{Hyp}{nativepdf}[true]{% \def\Hy@driver{hdvips}% @@ -1578,6 +1706,40 @@ \def\FancyVerbLineautorefname{Lyn}% \def\theoremautorefname{Teorema}% } +\def\HyLang@french{% + \def\equationautorefname{\'Equation}% + \def\footnoteautorefname{note}% + \def\itemautorefname{item}% + \def\figureautorefname{Figure}% + \def\tableautorefname{Tableau}% + \def\partautorefname{Partie}% + \def\appendixautorefname{Appendice}% + \def\chapterautorefname{chapitre}% + \def\sectionautorefname{section}% + \def\subsectionautorefname{sous-section}% + \def\subsubsectionautorefname{sous-sous-section}% + \def\paragraphautorefname{paragraphe}% + \def\subparagraphautorefname{sous-paragraphe}% + \def\FancyVerbLineautorefname{ligne}% + \def\theoremautorefname{Th\'eor\`eme}% +} +\def\HyLang@vietnamese{% + \def\equationautorefname{Ph\uhorn{}\ohorn{}ng tr\`inh}% + \def\footnoteautorefname{Ch\'u th\'ich}% + \def\itemautorefname{m\d{u}c}% + \def\figureautorefname{H\`inh}% + \def\tableautorefname{B\h{a}ng}% + \def\partautorefname{Ph\`\acircumflex{}n}% + \def\appendixautorefname{Ph\d{u} l\d{u}c}% + \def\chapterautorefname{ch\uhorn{}\ohorn{}ng}% + \def\sectionautorefname{m\d{u}c}% + \def\subsectionautorefname{m\d{u}c}% + \def\subsubsectionautorefname{m\d{u}c}% + \def\paragraphautorefname{\dj{}o\d{a}n}% + \def\subparagraphautorefname{\dj{}o\d{a}n}% + \def\FancyVerbLineautorefname{d\`ong}% + \def\theoremautorefname{\DJ{}\d{i}nh l\'y}% +} \def\HyLang@addto#1#2{% #2% \@temptokena{#2}% @@ -1604,7 +1766,7 @@ }% }% \expandafter\x\csname extras#1\expandafter\endcsname - \csname HyLang@#2\expandafter\endcsname + \csname HyLang@#2\endcsname } \HyLang@DeclareLang{english}{english} \HyLang@DeclareLang{UKenglish}{english} @@ -1620,6 +1782,27 @@ \HyLang@DeclareLang{portuguese}{portuges} \HyLang@DeclareLang{spanish}{spanish} \HyLang@DeclareLang{afrikaans}{afrikaans} +\HyLang@DeclareLang{french}{french} +\HyLang@DeclareLang{frenchb}{french} +\HyLang@DeclareLang{francais}{french} +\HyLang@DeclareLang{acadian}{french} +\HyLang@DeclareLang{canadien}{french} +\define@key{Hyp}{vietnamese}[]{% + \HyLang@addto\extrasvietnamese\HyLang@vietnamese + \AtEndOfPackage{% + \@ifundefined{T@PU}{}{% + \input{puvnenc.def}% + }% + }% +} +\define@key{Hyp}{vietnam}[]{% + \HyLang@addto\extrasvietnam\HyLang@vietnamese + \AtEndOfPackage{% + \@ifundefined{T@PU}{}{% + \input{puvnenc.def}% + }% + }% +} \define@key{Hyp}{colorlinks}[true]{% \Hy@boolkey{colorlinks}{#1}% \ifHy@colorlinks @@ -1635,6 +1818,35 @@ \define@key{Hyp}{bookmarksopen}[true]{% \Hy@boolkey{bookmarksopen}{#1}% } +\let\Hy@bookmarksdepth\c@tocdepth +\define@key{Hyp}{bookmarksdepth}[]{% + \begingroup + \edef\x{#1}% + \ifx\x\empty + \global\let\Hy@bookmarksdepth\c@tocdepth + \else + \@ifundefined{toclevel@\x}{% + \@onelevel@sanitize\x + \edef\y{\expandafter\@car\x\@nil}% + \ifcase 0\expandafter\ifx\y-1\fi + \expandafter\ifnum\expandafter`\y>47 % + \expandafter\ifnum\expandafter`\y<58 1\fi\fi\relax + \Hy@Warning{Unknown document division name (\x)}% + \else + \setbox\z@=\hbox{% + \count@=\x + \xdef\Hy@bookmarksdepth{\the\count@}% + }% + \fi + }{% + \setbox\z@=\hbox{% + \count@=\csname toclevel@\x\endcsname + \xdef\Hy@bookmarksdepth{\the\count@}% + }% + }% + \fi + \endgroup +} \define@key{Hyp}{bookmarksopenlevel}{% \def\@bookmarksopenlevel{#1}% } @@ -1681,15 +1893,52 @@ \global\Hy@useHidKeytrue \fi } -\define@key{Hyp}{linkbordercolor}{\def\@linkbordercolor{#1}} -\define@key{Hyp}{urlbordercolor}{\def\@urlbordercolor{#1}} -\define@key{Hyp}{menubordercolor}{\def\@menubordercolor{#1}} -\define@key{Hyp}{filebordercolor}{\def\@filebordercolor{#1}} -\define@key{Hyp}{runbordercolor}{\def\@runbordercolor{#1}} -\define@key{Hyp}{citebordercolor}{\def\@citebordercolor{#1}} -\define@key{Hyp}{pagebordercolor}{\def\@pagebordercolor{#1}} +\def\Hy@ColorList{cite,file,link,menu,page,run,url} +\@for\Hy@temp:=\Hy@ColorList\do{% + \edef\Hy@temp{% + \noexpand\define@key{Hyp}{\Hy@temp bordercolor}{% + \noexpand\Hy@bordercolor{\Hy@temp}{##1}{ }% + }% + }% + \Hy@temp +} +\def\Hy@bordercolor#1#2#3{% + \begingroup + \csname @safe@activestrue\endcsname + \@ifundefined{XC@edef}{\edef}{\XC@edef}\x{#2}% + \expandafter\Hy@CheckColorSpec\x#3#3\@nil{#1}{#2}% +} +\def\Hy@CheckColorSpec#1 #2 #3\@nil#4#5{% + \ifx\\#3\\% + \@ifundefined{XC@bordercolor}{% + \Hy@Warning{% + Unsupported color specification (#4bordercolor).\MessageBreak + Load package `xcolor' (version >= 1.11) first.\MessageBreak + Ignoring color specification% + }% + \endgroup + }{% + \endgroup + \XC@bordercolor{#4}{#5}% + }% + \else + \endgroup + \@namedef{@#4bordercolor}{#5}% + \fi +} \define@key{Hyp}{pdfhighlight}{\def\@pdfhighlight{#1}} \define@key{Hyp}{pdfborder}{\def\@pdfborder{#1}} +\define@key{Hyp}{pdfborderstyle}{\def\@pdfborderstyle{#1}} +\def\Hy@setpdfborder{% + \ifx\@pdfborder\@empty + \else + /Border[\@pdfborder]% + \fi + \ifx\@pdfborderstyle\@empty + \else + /BS<<\@pdfborderstyle>>% + \fi +} \define@key{Hyp}{pdfpagemode}{% \def\Hy@tempa{#1}% \ifx\Hy@tempa\@empty @@ -1713,6 +1962,8 @@ \define@key{Hyp}{pdfauthor}{\pdfstringdef\@pdfauthor{#1}} \define@key{Hyp}{pdfproducer}{\pdfstringdef\@pdfproducer{#1}} \define@key{Hyp}{pdfcreator}{\pdfstringdef\@pdfcreator{#1}} +\define@key{Hyp}{pdfcreationdate}{\pdfstringdef\@pdfcreationdate{#1}} +\define@key{Hyp}{pdfmoddate}{\pdfstringdef\@pdfmoddate{#1}} \define@key{Hyp}{pdfsubject}{\pdfstringdef\@pdfsubject{#1}} \define@key{Hyp}{pdfkeywords}{\pdfstringdef\@pdfkeywords{#1}} \define@key{Hyp}{pdfview}{\calculate@pdfview#1 \\} @@ -1761,6 +2012,9 @@ \define@key{Hyp}{pdfpagelabels}[true]{% \Hy@boolkey[pdfpagelabels]{pagelabels}{#1}% } +\define@key{Hyp}{pdfescapeform}[true]{% + \Hy@boolkey[pdfescapeform]{escapeform}{#1}% +} \def\@linkbordercolor{1 0 0} \def\@urlbordercolor{0 1 1} \def\@menubordercolor{1 0 0} @@ -1773,8 +2027,10 @@ \def\@pdfnonfullscreenpagemode{} \def\@pdftitle{} \def\@pdfauthor{} -\def\@pdfproducer{} +\let\@pdfproducer\relax \def\@pdfcreator{LaTeX with hyperref package} +\def\@pdfcreationdate{} +\def\@pdfmoddate{} \def\@pdfsubject{} \def\@pdfkeywords{} \def\@pdfpagescrop{} @@ -1802,32 +2058,14 @@ \Hy@SetCatcodes \let\ExecuteOptions\hyper@normalise \Hy@MaybeStopNow -\def\ProcessOptionsWithKV#1{% - \let\@tempc\relax - \let\Hy@tempa\@empty - \@for\CurrentOption:=\@classoptionslist\do{% - \@ifundefined{KV@#1@\CurrentOption}% - {}% - {% - \edef\Hy@tempa{\Hy@tempa,\CurrentOption,}% - \@expandtwoargs\@removeelement\CurrentOption - \@unusedoptionlist\@unusedoptionlist - }% - }% - \edef\Hy@tempa{% - \noexpand\setkeys{#1}{% - \Hy@tempa\@ptionlist{\@currname.\@currext}% - }% - }% - \Hy@tempa -} +\RequirePackage{kvoptions} \@ifpackageloaded{tex4ht}{% \@ifpackagewith{hyperref}{tex4ht}{}{% \PassOptionsToPackage{tex4ht}{hyperref}% }% }{} \let\ReadBookmarks\relax -\ProcessOptionsWithKV{Hyp} +\ProcessKeyvalOptions{Hyp} \AtBeginDocument{% \ifHy@draft \let\hyper@@anchor\@gobble @@ -1956,7 +2194,7 @@ \fi \fi \else - \ifcase\pdfoutput + \ifnum\pdfoutput<1 % \let\Hy@driver\Hy@defaultdriver \else \def\Hy@driver{hpdftex}% @@ -1965,6 +2203,32 @@ \Hy@breaklinkstrue \fi \fi + \ifx\Hy@driver\Hy@defaultdriver + \def\Hy@temp{hdvips}% + \ifx\Hy@temp\Hy@driver + \def\Hy@raisedlink{}% + \def\XR@ext{pdf}% + \fi + \def\Hy@temp{hdvipdfm}% + \ifx\Hy@temp\Hy@driver + \def\XR@ext{pdf}% + \Hy@breaklinkstrue + \fi + \def\Hy@temp{hdviwind}% + \ifx\Hy@temp\Hy@driver + \setkeys{Hyp}{colorlinks}% + \PassOptionsToPackage{dviwindo}{color}% + \fi + \def\Hy@temp{hdvipson}% + \ifx\Hy@temp\Hy@driver + \def\XR@ext{pdf}% + \def\Hy@raisedlink{}% + \fi + \def\Hy@temp{textures}% + \ifx\Hy@temp\Hy@driver + \def\XR@ext{pdf}% + \fi + \fi \typeout{*hyperref using default driver \Hy@driver*}% \else \typeout{*hyperref using driver \Hy@driver*}% @@ -2020,7 +2284,19 @@ \AtBeginDocument{% \ifHy@colorlinks \ifHy@typexml\else\RequirePackage{color}\fi - \def\Hy@colorlink#1{\begingroup\color{#1}}% + \def\Hy@colorlink#1{% + \begingroup + \expandafter\Hy@colorscan\expandafter#1#1\@nil% + }% + \def\Hy@colorscan#1{% + \@ifnextchar[% ] + {% + \Hy@@colorscan + }{% + \expandafter\color\expandafter#1\@car{}% + }% + }% + \def\Hy@@colorscan#1\@nil{\color#1}% \def\Hy@endcolorlink{\endgroup}% \Hy@Info{Link coloring ON}% \else @@ -2082,6 +2358,7 @@ \catcode`\%\active \catcode`\#\active \catcode`\_\active + \catcode`\$\active \gdef\hyper@normalise{ \begingroup \catcode`\^^M\active @@ -2092,6 +2369,7 @@ \catcode`\#\active \def#{\hyper@hash} \def\#{\hyper@hash} + \@makeother\& \edef\textunderscore{\string_} \let\_\textunderscore \catcode`\_\active @@ -2099,6 +2377,8 @@ \let~\hyper@tilde \let\~\hyper@tilde \let\textasciitilde\hyper@tilde + \let\\\@backslashchar + \edef${\string$} \ifx\@safe@activestrue\@undefined\else\@safe@activestrue\fi \hyper@n@rmalise } @@ -2197,8 +2477,10 @@ \def\label@hyperdef[#1]#2#3#4{% label name, category, name, % anchor text \@bsphack - \protected@write\@auxout{}% - {\string\newlabel{#1}{{}{}{}\##2.#3}}% + \if@filesw + \protected@write\@auxout{}% + {\string\newlabel{#1}{{}{}{}\##2.#3}}% + \fi \@esphack \ifHy@nesting \hyper@@anchor{#2.#3}{#4}% @@ -2244,14 +2526,14 @@ \ifx\@pdftempa\@pdftempwordrun \expandafter\@hyper@launch#7\\{#3}{#2}% \else - \hyper@linkurl{#3}{#7\ifx\\#2\\\else\##2\fi}% + \hyper@linkurl{#3}{#7\ifx\\#2\\\else\hyper@hash#2\fi}% \fi \fi \fi \fi } \def\@hyper@launch run:#1\\#2#3{% filename, anchor text, linkname - \hyper@linkurl{#2}{\Hy@linkfileprefix#1\ifx\\#3\\\else\##3\fi}% + \hyper@linkurl{#2}{\Hy@linkfileprefix#1\ifx\\#3\\\else\hyper@hash#3\fi}% } \def\@hyper@linkfile file:#1\\#2#3{% %file url,link string, name @@ -2265,10 +2547,10 @@ \else \ifx\@baseurl\@empty \hyper@linkurl{#2}{% - \Hy@linkfileprefix\use@file\ifx\\#3\\\else\##3\fi + \Hy@linkfileprefix\use@file\ifx\\#3\\\else\hyper@hash#3\fi }% \else - \hyper@linkurl{#2}{\use@file\ifx\\#3\\\else\##3\fi}% + \hyper@linkurl{#2}{\use@file\ifx\\#3\\\else\hyper@hash#3\fi}% \fi \fi } @@ -2357,8 +2639,9 @@ \csname Form@#2\ifx\relax#1\relax true\else#1\fi\endcsname } \define@key{Form}{action}{% - \def\Form@action{#1}% + \hyper@normalise\Hy@DefFormAction{#1}% } +\def\Hy@DefFormAction{\def\Form@action} \def\enc@@html{html} \define@key{Form}{encoding}{% \def\Hy@tempa{#1}% @@ -2692,12 +2975,12 @@ } \AfterBeginDocument{% \if@filesw - \ifHy@typexml - \immediate\closeout\@mainaux - \immediate\openout\@mainaux\jobname.aux - \immediate\write\@auxout{<relaxxml>\relax}% - \fi - \immediate\write\@auxout{% + \ifHy@typexml + \immediate\closeout\@mainaux + \immediate\openout\@mainaux\jobname.aux + \immediate\write\@auxout{<relaxxml>\relax}% + \fi + \immediate\write\@auxout{% \string\ifx\string\hyper@anchor\string\@undefined^^J% \global\let\string\oldcontentsline\string\contentsline^^J% \gdef\string\contentsline% @@ -2925,7 +3208,9 @@ } \providecommand*{\HyPL@StorePageLabel}[1]{} \def\HyPL@Useless{0 << /S /D >> }% + \@onelevel@sanitize\HyPL@Useless \def\HyPL@SetPageLabels{% + \@onelevel@sanitize\HyPL@Labels \ifx\HyPL@Labels\@empty \else \ifx\HyPL@Labels\HyPL@Useless @@ -3073,8 +3358,7 @@ \ifHy@plainpages \def\Hy@temp{\arabic{page}}% \else - \let\textlatin\@firstofone - \edef\Hy@temp{\thepage}% + \pdfstringdef\Hy@temp{\thepage}% \fi \else \def\Hy@temp{\the\Hy@pagecounter}% @@ -3091,49 +3375,8 @@ }% }{}% } -\newcommand*{\hypergetpageref}[1]{% - \expandafter\Hy@getpageref\csname r@#1\endcsname{#1}% -} -\def\Hy@getpageref#1#2{% - \ifx#1\relax - 0% - \protect\G@refundefinedtrue - \@latex@warning{Reference `#2' on page \thepage\space - undefined% - }% - \else - \expandafter\Hy@GetSecondArg#1\@nil - \fi -} -\long\def\Hy@GetSecondArg#1#2#3\@nil{#2} -\newcommand*{\hypergetref}[1]{% - \expandafter\Hy@getref\csname r@#1\endcsname{#1}% -} -\def\Hy@getref#1#2{% - \ifx#1\relax - ??% - \protect\G@refundefinedtrue - \@latex@warning{Reference `#2' on page \thepage\space - undefined% - }% - \else - \expandafter\@car#1\@nil - \fi -} -\@ifpackageloaded{ifthen}{% - \let\HyOrg@ifthenelse\ifthenelse - \def\ifthenelse{% - \let\begingroup\Hy@TE@begingroup - \HyOrg@ifthenelse - }% - \let\HyOrg@begingroup\begingroup - \def\Hy@TE@begingroup{% - \let\begingroup\HyOrg@begingroup - \begingroup - \let\ref\hypergetref - \let\pageref\hypergetpageref - }% -}{} +\def\hypergetref#1{\getrefbykeydefault{#1}{}{??}} +\def\hypergetpageref#1{\getrefbykeydefault{#1}{page}{0}} \@ifpackageloaded{titlesec}{% \def\ttl@Hy@steplink#1{% \Hy@GlobalStepCount\Hy@linkcounter @@ -3152,12 +3395,13 @@ \@ifpackageloaded{titletoc}{% \def\ttl@gobblecontents#1#2#3#4{\ignorespaces}% }{} +\def\Hy@varioref@undefined{{???}{??}{}{}{}} \@ifpackageloaded{varioref}{% \def\vref@pagenum#1#2{% \@ifundefined{r@#2}{% - \@namedef{r@#2}{{??}{??}{}{}{}}% + \expandafter\let\csname r@#2\endcsname\Hy@varioref@undefined }{}% - \edef#1{\hypergetpageref{#2}}% + \edef#1{\getpagerefnumber{#2}}% }% }{} \@ifpackageloaded{longtable}{% @@ -3442,6 +3686,7 @@ } \long\def\@caption#1[#2]#3{% \hyper@makecurrent{\@captype}% + \def\@currentlabelname{#2}% \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% }% @@ -3472,7 +3717,10 @@ \renewcommand{\float@makebox}[1]{% \HyOrg@float@makebox{% #1\relax - \hyper@@anchor{\@currentHref}{\relax}% + \begingroup + \hyper@makecurrent{\@captype}% + \hyper@@anchor{\@currentHref}{\relax}% + \endgroup }% }% }{} @@ -3617,13 +3865,15 @@ \ifx\@empty\@currentlabel \else \@bsphack - \protected@write\@auxout{}{% - \string\@writefile{brf}{% - \string\backcite{#1}{% - {\thepage}{\@currentlabel}{\@currentHref}% + \if@filesw + \protected@write\@auxout{}{% + \string\@writefile{brf}{% + \string\backcite{#1}{% + {\thepage}{\@currentlabel}{\@currentHref}% + }% }% }% - }% + \fi \@esphack \fi \fi @@ -3706,9 +3956,7 @@ \global\let\@begindvi\Hy@begindvi } \def\Hy@begindvi{% - \ifHy@pageanchor - \@hyperfixhead - \fi + \@hyperfixhead \HyPL@EveryPage } \def\pagenumbering#1{% @@ -3721,20 +3969,23 @@ \providecommand\hyper@pagehidden{} \def\@hyperfixhead{% \Hy@DistillerDestFix - \ifHy@hypertexnames - \ifHy@plainpages - \gdef\Hy@TempPageAnchor{\hyper@@anchor{page.\the\c@page}}% + \ifHy@pageanchor + \ifHy@hypertexnames + \ifHy@plainpages + \gdef\Hy@TempPageAnchor{\hyper@@anchor{page.\the\c@page}}% + \else + \begingroup + \let\@number\@firstofone + \pdfstringdef\@the@H@page{\thepage}% + \endgroup + \gdef\Hy@TempPageAnchor{\hyper@@anchor{page.\@the@H@page}}% + \fi \else - \begingroup - \let\@number\@firstofone - \let\textlatin\@firstofone - \xdef\@the@H@page{\thepage}% - \endgroup - \gdef\Hy@TempPageAnchor{\hyper@@anchor{page.\@the@H@page}}% + \Hy@GlobalStepCount\Hy@pagecounter + \gdef\Hy@TempPageAnchor{\hyper@@anchor{page.\the\Hy@pagecounter}}% \fi \else - \Hy@GlobalStepCount\Hy@pagecounter - \gdef\Hy@TempPageAnchor{\hyper@@anchor{page.\the\Hy@pagecounter}}% + \let\Hy@TempPageAnchor\@empty \fi \let\H@old@thehead\@thehead \if^\@thehead^% @@ -3818,9 +4069,11 @@ {\Hy@toclevel}% {#1}% \ifHy@verbose + \def\Hy@tempa{#3}% + \@onelevel@sanitize\Hy@tempa \typeout{pdftex: bookmark at \the\inputlineno: {\csname the#2\endcsname} - {#3} + {\Hy@tempa} {\@currentHref}% {\Hy@toclevel}% {#1}% @@ -3950,22 +4203,24 @@ \else \def\@wrindex#1{\@@wrindex#1||\\} \def\@@wrindex#1|#2|#3\\{% - \ifx\\#2\\% - \protected@write\@indexfile{}{% - \string\indexentry{#1|hyperpage}{\thepage}% - }% - \else - \def\Hy@temp@A{#2}% - \ifcase0\ifx\Hy@temp@A\HyInd@ParenLeft 1\fi - \ifx\Hy@temp@A\HyInd@ParenRight 1\fi - \relax + \if@filesw + \ifx\\#2\\% \protected@write\@indexfile{}{% - \string\indexentry{#1|#2}{\thepage}% + \string\indexentry{#1|hyperpage}{\thepage}% }% \else - \protected@write\@indexfile{}{% - \string\indexentry{#1|#2hyperpage}{\thepage}% - }% + \def\Hy@temp@A{#2}% + \ifcase0\ifx\Hy@temp@A\HyInd@ParenLeft 1\fi + \ifx\Hy@temp@A\HyInd@ParenRight 1\fi + \relax + \protected@write\@indexfile{}{% + \string\indexentry{#1|#2}{\thepage}% + }% + \else + \protected@write\@indexfile{}{% + \string\indexentry{#1|#2hyperpage}{\thepage}% + }% + \fi \fi \fi \endgroup @@ -4259,19 +4514,19 @@ \@safe@activesfalse } \def\auto@setref#1#2#3{% csname, extract group, refname - \ifx#1\relax - \protect\G@refundefinedtrue - \nfss@text{\reset@font\bfseries ??}% - \@latex@warning{% - Reference `#3' on page \thepage \space undefined% - }% - \else + \ifcase 0\ifx#1\relax 1\fi\ifx#1\Hy@varioref@undefined 1\fi\relax \edef\@thisref{\expandafter\@fourthoffive#1\@empty\@empty}% \expandafter\test@reftype\@thisref\\% \hyper@@link {\expandafter\@fifthoffive#1}% {\expandafter\@fourthoffive#1\@empty\@empty}% {\@currentHtag\expandafter#2#1\@empty\@empty\null}% + \else + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{% + Reference `#3' on page \thepage \space undefined% + }% \fi } \def\test@reftype#1.#2\\{% @@ -4308,9 +4563,9 @@ \providecommand\theoremautorefname{Theorem} \providecommand*{\Hy@DistillerDestFix}{} \def\phantomsection{% - \Hy@GlobalStepCount\Hy@linkcounter - \xdef\@currentHref{section*.\the\Hy@linkcounter}% - \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}% + \Hy@GlobalStepCount\Hy@linkcounter + \xdef\@currentHref{section*.\the\Hy@linkcounter}% + \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}% } \endinput %% |