diff options
author | Karl Berry <karl@freefriends.org> | 2010-09-14 23:56:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-09-14 23:56:54 +0000 |
commit | 6a202048032d41223115d64328753cae0efeca55 (patch) | |
tree | 37c51c814990236275ffd25da210a5e4e0781662 /Master/texmf-dist/tex/latex/hyperref/hyperref.sty | |
parent | 3d0cb91a86809c8becca994b9f708c9cc8eb7fdc (diff) |
hyperref update (15sep10)
git-svn-id: svn://tug.org/texlive/trunk@19734 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 | 346 |
1 files changed, 238 insertions, 108 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty index d7c55490684..ee45a5ee31d 100644 --- a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty +++ b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty @@ -30,7 +30,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{hyperref} - [2010/09/11 v6.81m + [2010/09/13 v6.81n Hypertext links for LaTeX] \begingroup \@makeother\`% @@ -100,6 +100,7 @@ \endgroup \Hy@SetCatcodes \RequirePackage{ltxcmds}[2010/03/09] +\RequirePackage{infwarerr}[2010/04/08] \RequirePackage{keyval}[1997/11/10] \RequirePackage{kvsetkeys}[2007/09/29] \RequirePackage{pdfescape}[2007/11/11] @@ -108,9 +109,18 @@ \RequirePackage{ifxetex}[2006/08/21] \RequirePackage{hycolor} \RequirePackage{letltxmacro}[2008/06/13] -\def\Hy@Warning#1{\PackageWarning{hyperref}{#1}} -\def\Hy@WarningNoLine#1{\PackageWarningNoLine{hyperref}{#1}} -\def\Hy@Info#1{\PackageInfo{hyperref}{#1}} +\def\Hy@Error#1{\@PackageError{hyperref}} +\def\Hy@Warning#1{\@PackageWarning{hyperref}{#1}} +\def\Hy@WarningNoLine#1{\@PackageWarningNoLine{hyperref}{#1}} +\def\Hy@Info#1{\@PackageInfo{hyperref}{#1}} +\def\Hy@InfoNoLine{\@PackageInfoNoLine{hyperref}} +\def\Hy@Message#1{% + \GenericWarning{% + (hyperref)\@spaces\@spaces\@spaces\@spaces + }{% + Package hyperref Message: #1\ltx@gobble + }% +} \ltx@IfUndefined{pdfmatch}{% \def\Hy@Match#1#2#3#4{}% }{% @@ -169,6 +179,7 @@ \let\Hy@AtBeginDocumentHook\@undefined }% } +\RequirePackage{kvoptions}[2009/07/21] \newif\ifHy@typexml \newif\ifHy@activeanchor \newif\ifHy@backref @@ -2276,6 +2287,10 @@ \fi \fi }% +\SetupKeyvalOptions{% + family=Hyp,% + prefix=HyOpt% +} \def\Hy@boolkey{\@dblarg\Hy@@boolkey} \def\Hy@@boolkey[#1]#2#3{% \edef\Hy@tempa{#3}% @@ -2500,7 +2515,7 @@ \ifx\HyPsd@LoadUnicode\relax \else \def\HyPsd@LoadUnicode{% - \PackageError{hyperref}{% + \Hy@Error{% Unicode support for bookmarks is not available.\MessageBreak Activate unicode support by using one of the options\MessageBreak `unicode', `pdfencoding=unicode', `pdfencoding=auto'\MessageBreak @@ -2590,14 +2605,43 @@ \@namedef{Hy@pdfversion@1.8}{8}% \@namedef{Hy@pdfversion@1.9}{9}% \def\Hy@pdfversion{2} -\define@key{Hyp}{hyperref}[true]{} -\define@key{Hyp}{tex4ht}[true]{% +\newif\ifHy@DviMode +\let\Hy@DviErrMsg\ltx@empty +\ifpdf + \def\Hy@DviErrMsg{pdfTeX or LuaTeX is running in PDF mode}% +\else + \ifxetex + \def\Hy@DviErrMsg{XeTeX is running}% + \else + \ifvtex + \ifvtexdvi + \Hy@DviModetrue + \else + \def\Hy@DviErrMsg{VTeX is running, but not in DVI mode}% + \fi + \else + \Hy@DviModetrue + \fi + \fi +\fi +\def\HyOpt@CheckDvi#1{% + \ifHy@DviMode + \expandafter\ltx@firstofone + \else + \Hy@Error{% + Wrong DVI mode driver option `#1',\MessageBreak + because \Hy@DviErrMsg + }\@ehc + \expandafter\ltx@gobble + \fi +} +\DeclareVoidOption{tex4ht}{% \Hy@texhttrue \kvsetkeys{Hyp}{colorlinks=true}% - \def\BeforeTeXIVht{\usepackage{color}}% + \def\BeforeTeXIVht{\RequirePackage{color}}% \def\Hy@driver{htex4ht}% \def\MaybeStopEarly{% - \typeout{Hyperref stopped early}% + \Hy@Message{Stopped early}% \Hy@AtBeginDocument{% \PDF@FinishDoc \gdef\PDF@FinishDoc{}% @@ -2605,17 +2649,30 @@ \endinput }% } -\define@key{Hyp}{pdftex}[true]{% - \def\Hy@driver{hpdftex}% +\DeclareVoidOption{pdftex}{% + \ifpdf + \def\Hy@driver{hpdftex}% + \else + \Hy@Error{% + Wrong driver option `pdftex',\MessageBreak + because pdfTeX in PDF mode is not detected% + }\@ehc + \fi } -\define@key{Hyp}{nativepdf}[true]{% - \def\Hy@driver{hdvips}% +\DeclareVoidOption{nativepdf}{% + \HyOpt@CheckDvi{nativepdf}{% + \def\Hy@driver{hdvips}% + }% } -\define@key{Hyp}{dvipdfm}[true]{% - \def\Hy@driver{hdvipdfm}% +\DeclareVoidOption{dvipdfm}{% + \HyOpt@CheckDvi{dvipdfm}{% + \def\Hy@driver{hdvipdfm}% + }% } -\define@key{Hyp}{dvipdfmx}[true]{% - \def\Hy@driver{hdvipdfm}% +\DeclareVoidOption{dvipdfmx}{% + \HyOpt@CheckDvi{dvipdfmx}{% + \def\Hy@driver{hdvipdfm}% + }% } \define@key{Hyp}{dvipdfmx-outline-open}[true]{% \expandafter\ifx\csname if#1\expandafter\endcsname @@ -2625,33 +2682,41 @@ \chardef\SpecialDvipdfmxOutlineOpen\z@ \fi } -\define@key{Hyp}{xetex}[true]{% - \def\Hy@driver{hxetex}% +\DeclareVoidOption{xetex}{% + \ifxetex + \def\Hy@driver{hxetex}% + \else + \Hy@Error{% + Wrong driver option `xetex',\MessageBreak + because XeTeX is not detected% + }\@ehc + \fi } -\define@key{Hyp}{pdfmark}[true]{% - \def\Hy@driver{hdvips}% +\DeclareVoidOption{pdfmark}{% + \HyOpt@CheckDvi{pdfmark}{% + \def\Hy@driver{hdvips}% + }% } -\define@key{Hyp}{dvips}[true]{% - \def\Hy@driver{hdvips}% +\DeclareVoidOption{dvips}{% + \HyOpt@CheckDvi{dvips}{% + \def\Hy@driver{hdvips}% + }% } -\define@key{Hyp}{hypertex}[true]{% - \def\Hy@driver{hypertex}% +\DeclareVoidOption{hypertex}{% + \HyOpt@CheckDvi{hypertex}{% + \def\Hy@driver{hypertex}% + }% } \let\Hy@MaybeStopNow\relax -\define@key{Hyp}{vtex}[true]{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname OpMode\endcsname\relax - \@latex@error{Non-VTeX processor}{}% - \global\let\Hy@MaybeStopNow\endinput - \endinput - \else +\DeclareVoidOption{vtex}{% + \ifvtex \ifnum 0\ifnum\OpMode<1 1\fi \ifnum\OpMode>3 1\fi =0 % \def\Hy@driver{hvtex}% \else \ifnum\OpMode=10\relax \def\Hy@driver{hvtexhtm}% \def\MaybeStopEarly{% - \typeout{Hyperref stopped early}% + \Hy@Message{Stopped early}% \Hy@AtBeginDocument{% \PDF@FinishDoc \gdef\PDF@FinishDoc{}% @@ -2659,52 +2724,74 @@ \endinput }% \else - \@latex@error{Mode (\the\OpMode) has no hyperref driver}{}% - \global\let\Hy@MaybeStopNow\endinput - \endinput + \Hy@Error{% + Wrong driver option `vtex',\MessageBreak + because of wrong OpMode (\the\OpMode)% + }\@ehc \fi \fi + \else + \Hy@Error{% + Wrong driver option `vtex',\MessageBreak + because VTeX is not running% + }\@ehc \fi } -\define@key{Hyp}{vtexpdfmark}[true]{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname OpMode\endcsname\relax - \@latex@error{Non-VTeX processor}{}% - \let\Hy@MaybeStopNow\endinput - \endinput - \else +\DeclareVoidOption{vtexpdfmark}{% + \ifvtex \ifnum 0\ifnum\OpMode<1 1\fi \ifnum\OpMode>3 1\fi =0 % \def\Hy@driver{hvtexmrk}% \else - \@latex@error{Mode (\the\OpMode) has no hyperref driver}{}% - \let\Hy@MaybeStopNow\endinput - \endinput + \Hy@Error{% + Wrong driver option `vtexpdfmark',\MessageBreak + because of wrong OpMode (\the\OpMode)% + }\@ehc \fi - \fi -} -\define@key{Hyp}{dviwindo}[true]{% - \def\Hy@driver{hdviwind}% - \kvsetkeys{Hyp}{colorlinks}% - \ifpdf \else - \ifxetex - \else - \PassOptionsToPackage{dviwindo}{color}% - \fi + \Hy@Error{% + Wrong driver option `vtexpdfmark,\MessageBreak + because VTeX is not running% + }\@ehc \fi } -\define@key{Hyp}{dvipsone}[true]{% - \def\Hy@driver{hdvipson}% +\DeclareVoidOption{dviwindo}{% + \HyOpt@CheckDvi{dviwindo}{% + \def\Hy@driver{hdviwind}% + \kvsetkeys{Hyp}{colorlinks}% + \PassOptionsToPackage{dviwindo}{color}% + }% +} +\DeclareVoidOption{dvipsone}{% + \HyOpt@CheckDvi{dvipsone}{% + \def\Hy@driver{hdvipson}% + }% } -\define@key{Hyp}{textures}[true]{% - \def\Hy@driver{htexture}% +\DeclareVoidOption{textures}{% + \HyOpt@CheckDvi{textures}{% + \def\Hy@driver{htexture}% + }% +} +\DeclareVoidOption{latex2html}{% + \HyOpt@CheckDvi{latex2html}{% + \Hy@AtBeginDocument{\@@latextohtmlX}% + }% } -\define@key{Hyp}{latex2html}[true]{% - \Hy@AtBeginDocument{\@@latextohtmlX}% +\DeclareVoidOption{ps2pdf}{% + \HyOpt@CheckDvi{ps2pdf}{% + \def\Hy@driver{hdvips}% + }% } -\define@key{Hyp}{ps2pdf}[true]{% - \def\Hy@driver{hdvips}% - \providecommand*\@pdfborder{0 0 1}% +\let\HyOpt@DriverFallback\ltx@empty +\define@key{Hyp}{driverfallback}{% + \ifHy@DviMode + \def\HyOpt@DriverFallback{#1}% + \Hy@Match\HyOpt@DriverFallback{% + ^(|dvipdfm|dvipdfmx|dvips|dvipsone|dviwindo|hypertex|ps2pdf|% + latex2html|tex4ht)$% + }{}{% + \let\HyOpt@DriverFallback\ltx@empty + }% + \fi } \define@key{Hyp}{hyperfigures}[true]{% \Hy@boolkey[hyperfigures]{figures}{#1}% @@ -3018,7 +3105,7 @@ \HyLang@DeclareLang{italian}{italian}{} \HyLang@DeclareLang{magyar}{magyar}{} \HyLang@DeclareLang{hungarian}{magyar}{} -\define@key{Hyp}{vietnamese}[]{% +\DeclareVoidOption{vietnamese}{% \HyLang@addto\extrasvietnamese\HyLang@vietnamese \Hy@AtEndOfPackage{% \@ifundefined{T@PU}{}{% @@ -3026,7 +3113,7 @@ }% }% } -\define@key{Hyp}{vietnam}[]{% +\DeclareVoidOption{vietnam}{% \HyLang@addto\extrasvietnam\HyLang@vietnamese \Hy@AtEndOfPackage{% \@ifundefined{T@PU}{}{% @@ -3034,7 +3121,7 @@ }% }% } -\define@key{Hyp}{arabic}[]{% +\DeclareVoidOption{arabic}{% \Hy@AtEndOfPackage{% \@ifundefined{T@PU}{}{% \input{puarenc.def}% @@ -3163,9 +3250,23 @@ \define@key{Hyp}{linkfileprefix}{\hyperlinkfileprefix{#1}} \hyperlinkfileprefix{file:} \let\@pdfpagetransition\relax -\define@key{Hyp}{pdfpagetransition}{\def\@pdfpagetransition{#1}} +\define@key{Hyp}{pdfpagetransition}{% + \def\@pdfpagetransition{#1}% +} \let\@pdfpageduration\relax -\define@key{Hyp}{pdfpageduration}{\def\@pdfpageduration{#1}} +\define@key{Hyp}{pdfpageduration}{% + \def\@pdfpageduration{#1}% + \Hy@Match\@pdfpageduration{% + ^(|[0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)$% + }{}{% + \Hy@Warning{% + Invalid value `\@pdfpageduration'\MessageBreak + of `pdfpageduration'\MessageBreak + is replaced by an empty value% + }% + \let\@pdfpageduration\ltx@empty + }% +} \newif\ifHy@useHidKey \Hy@useHidKeyfalse \define@key{Hyp}{pdfpagehidden}[true]{% @@ -3201,7 +3302,23 @@ \do{/O}{Outline}% \do{/P}{Push}% } -\define@key{Hyp}{pdfborder}{\def\@pdfborder{#1}} +\define@key{Hyp}{pdfborder}{% + \def\Hy@temp{#1}% + \Hy@Match\Hy@temp{% + ^(\HyPat@NonNegativeReal/ % + \HyPat@NonNegativeReal/ % + \HyPat@NonNegativeReal/% + ( ?[\HyPat@NonNegativeReal/( \HyPat@NonNegativeReal/)*])?)$% + }{% + \let\@pdfborder\Hy@temp + }{% + \Hy@Warning{% + Invalid value `\Hy@temp'\MessageBreak + for option `pdfborder'.\MessageBreak + Option setting is ignored% + }% + }% +} \define@key{Hyp}{pdfborderstyle}{\def\@pdfborderstyle{#1}} \def\Hy@setpdfborder{% \ifx\@pdfborder\@empty @@ -3660,7 +3777,6 @@ \Hy@SetCatcodes \let\ExecuteOptions\hyper@normalise \Hy@MaybeStopNow -\RequirePackage{kvoptions}[2009/07/21] \SetupKeyvalOptions{family=Hyp} \DeclareLocalOptions{% a4paper,a5paper,b5paper,letterpaper,legalpaper,executivepaper% @@ -3724,7 +3840,7 @@ \expandafter\endgroup \ifx\y Y% \else - \PackageError{hyperref}{% + \Hy@Error{% PDF/A: Named action `#1' is not permitted% }\@ehc {#2}% @@ -3782,11 +3898,11 @@ \fi \Hy@DisableOption{typexml} \ifHy@implicit - \typeout{Implicit mode ON; LaTeX internals redefined}% + \Hy@InfoNoLine{Implicit mode ON; LaTeX internals redefined}% \else - \typeout{Implicit mode OFF; no redefinition of LaTeX internals}% + \Hy@InfoNoLine{Implicit mode OFF; no redefinition of LaTeX internals}% \def\MaybeStopEarly{% - \typeout{Hyperref stopped early}% + \Hy@Message{Stopped early}% \Hy@AtBeginDocument{% \PDF@FinishDoc \gdef\PDF@FinishDoc{}% @@ -3875,7 +3991,9 @@ \fi \fi \fi + \def\HyOpt@DriverType{}% \ifx\Hy@driver\@empty + \def\HyOpt@DriverType{ (autodetected)}% \providecommand*{\Hy@defaultdriver}{hypertex}% \ifpdf \def\Hy@driver{hpdftex}% @@ -3886,7 +4004,7 @@ \ifvtexhtml \def\Hy@driver{hvtexhtm}% \def\MaybeStopEarly{% - \typeout{Hyperref stopped early}% + \Hy@Message{Stopped early}% \Hy@AtBeginDocument{% \PDF@FinishDoc \gdef\PDF@FinishDoc{}% @@ -3900,7 +4018,23 @@ \ifvtexps \def\Hy@driver{hvtex}% \else - \let\Hy@driver\Hy@defaultdriver + \ifx\HyOpt@DriverFallback\ltx@empty + \let\Hy@driver\Hy@defaultdriver + \def\HyOpt@DriverType{ (default)}% + \else + \begingroup + \toks@\expandafter{\HyOpt@DriverFallback}% + \edef\x{\endgroup + \noexpand\kvsetkeys{Hyp}{\the\toks@}% + }% + \x + \ifx\Hy@driver\ltx@empty + \let\Hy@driver\Hy@defaultdriver + \def\HyOpt@DriverType{ (default)}% + \else + \def\HyOpt@DriverType{ (fallback)}% + \fi + \fi \fi \fi \fi @@ -3913,13 +4047,29 @@ \PassOptionsToPackage{dviwindo}{color}% \fi \fi - \typeout{* hyperref using default driver \Hy@driver\ltx@space*}% - \else - \typeout{* hyperref using driver \Hy@driver\ltx@space*}% \fi + \Hy@Message{Driver\HyOpt@DriverType: \Hy@driver}% \input{\Hy@driver.def}% \let\@unprocessedoptions\relax \Hy@RestoreCatcodes + \Hy@DisableOption{tex4ht}% + \Hy@DisableOption{pdftex}% + \Hy@DisableOption{nativepdf}% + \Hy@DisableOption{dvipdfm}% + \Hy@DisableOption{dvipdfmx}% + \Hy@DisableOption{dvipdfmx-outline-open}% + \Hy@DisableOption{pdfmark}% + \Hy@DisableOption{dvips}% + \Hy@DisableOption{hypertex}% + \Hy@DisableOption{vtex}% + \Hy@DisableOption{vtexpdfmark}% + \Hy@DisableOption{dviwindo}% + \Hy@DisableOption{dvipsone}% + \Hy@DisableOption{textures}% + \Hy@DisableOption{latex2html}% + \Hy@DisableOption{ps2pdf}% + \Hy@DisableOption{xetex}% + \Hy@DisableOption{pdfversion}% } \newif\ifHy@DvipdfmxOutlineOpen \ifxetex @@ -3935,26 +4085,6 @@ \Hy@DvipdfmxOutlineOpentrue \fi \fi -\Hy@DisableOption{tex4ht} -\Hy@DisableOption{pdftex} -\Hy@DisableOption{nativepdf} -\Hy@DisableOption{dvipdfm} -\Hy@DisableOption{dvipdfmx} -\Hy@DisableOption{dvipdfmx-outline-open} -\Hy@DisableOption{pdfmark} -\Hy@DisableOption{dvips} -\Hy@DisableOption{hypertex} -\Hy@DisableOption{vtex} -\Hy@DisableOption{vtexpdfmark} -\Hy@DisableOption{dviwindo} -\Hy@DisableOption{dvipsone} -\Hy@DisableOption{textures} -\Hy@DisableOption{latex2html} -\Hy@DisableOption{ps2pdf} -\Hy@DisableOption{xetex} -\Hy@AtEndOfPackage{% - \Hy@DisableOption{pdfversion}% -} \def\WriteBookmarks{0} \def\@bookmarkopenstatus#1{% \ifHy@bookmarksopen @@ -4288,7 +4418,7 @@ \newif\ifHy@href@ismap \define@key{href}{ismap}[true]{% \ltx@IfUndefined{Hy@href@ismap#1}{% - \PackageError{hyperref}{% + \Hy@Error{% Invalid value (#1) for key `ismap'.\MessageBreak Permitted values are `true' or `false'.\MessageBreak Ignoring `ismap'% @@ -4453,7 +4583,7 @@ \else \ifx\@pdftempa\@pdftempwordrun \ifHy@pdfa - \PackageError{hyperref}{% + \Hy@Error{% PDF/A: Launch action is prohibited% }\@ehc \begingroup @@ -4744,7 +4874,7 @@ \lowercase{\def\Hy@temp{#1}}% \@ifundefined{Fld@export@\Hy@temp}{% \@onelevel@sanitize\Hy@temp - \PackageError{hyperref}{% + \Hy@Error{% Unknown export format `\Hy@temp'.\MessageBreak Known formats are `FDF', `HTML', `XFDF', and `PDF'% }\@ehc @@ -4868,7 +4998,7 @@ \else\ifFld@password \else\ifFld@fileselect \else 1\fi\fi\fi\relax - \PackageError{hyperref}{% + \Hy@Error{% Field option `comb' cannot used together with\MessageBreak `multiline', `password', or `fileselect'% }\@ehc @@ -5064,7 +5194,7 @@ \lowercase{\def\Hy@temp{#1}}% \@ifundefined{Form@method@\Hy@temp}{% \@onelevel@sanitize\Hy@temp - \PackageError{hyperref}{% + \Hy@Error{% Unknown method `\Hy@temp'.\MessageBreak Known values are `post' and `get'% }\@ehc @@ -5229,7 +5359,7 @@ \def\Hy@@temp#1#2{% \ifHy@pdfa \define@key{Field}{#2}{% - \PackageError{hyperref}{% + \Hy@Error{% PDF/A: Additional action `#2' is prohibited% }\@ehc }% @@ -5278,7 +5408,7 @@ \else \ifHy@pdfa \define@key{Field}{onclick}{% - \PackageError{hyperref}{% + \Hy@Error{% PDF/A: Action `onclick' is prohibited% }\@ehc }% |