summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-09-26 18:04:39 +0000
committerKarl Berry <karl@freefriends.org>2007-09-26 18:04:39 +0000
commit780147d5e6685f9f44d3291c4ba3994886f99d02 (patch)
treed1f6b9c05ab35558a443b77bda3288a397cb56d0 /Master/texmf-dist/source
parent75d7894d4540af87617452c46d796b487b5d9e5b (diff)
hyperref update
git-svn-id: svn://tug.org/texlive/trunk@5053 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hyperref.dtx176
-rw-r--r--Master/texmf-dist/source/latex/hyperref/nameref.dtx2
2 files changed, 137 insertions, 41 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
index 858d82ba132..0f87ca726b4 100644
--- a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
@@ -39,7 +39,7 @@
%<puenc>\ProvidesFile{puenc.def}
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
-%<!none> [2007/05/29 v6.76g
+%<!none> [2007/06/14 v6.76i
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -116,7 +116,7 @@
\end{document}
%</driver>
% \fi
-% \CheckSum{20970}
+% \CheckSum{21126}
%
% \MakeShortVerb{|}
% \StopEventually{}
@@ -321,7 +321,7 @@
% of a \LaTeX\ definition (number of arguments).
% \begin{macrocode}
\def\HyC@nc@opt[#1]{%
- \def\HyC@param{[#1]}%
+ \def\HyC@param{[{#1}]}%
\@ifnextchar[\HyC@nc@default\HyC@nc@noopt
}
% \end{macrocode}
@@ -1544,8 +1544,27 @@
% the masks \cs{8} and \cs{9} are removed and the Unicode
% marker is added.
% \begin{macrocode}
+ \endgroup
+ \begingroup
\ifHy@unicode
\HyPsd@ConvertToUnicode#1%
+% \end{macrocode}
+%
+% \paragraph{Try conversion back to PDFDocEncoding.}
+%
+% \begin{macrocode}
+ \ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
+ \@ifundefined{StringEncodingConvertTest}{%
+ }{%
+ \EdefUnescapeString\HyPsd@temp#1%
+ \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
+ {utf16be}{pdfdoc}{%
+ \EdefEscapeString\HyPsd@temp\HyPsd@temp
+ \global\let#1\HyPsd@temp
+ \Hy@unicodefalse
+ }{}%
+ }%
+ \fi
\fi
% \end{macrocode}
%
@@ -3728,7 +3747,93 @@
% \begin{macrocode}
\define@key{Hyp}{unicode}[true]{%
\Hy@boolkey{unicode}{#1}%
- \HyPsd@InitUnicode
+ \ifHy@unicode
+ \def\HyPsd@pdfencoding{unicode}%
+ \else
+ \def\HyPsd@pdfencoding{pdfdoc}%
+ \fi
+ \HyPsd@LoadUnicode
+}
+\def\HyPsd@LoadUnicode{%
+ \@ifundefined{T@PU}{\input{puenc.def}}{}%
+ \DeclareFontFamily{PU}{pdf}{}%
+ \DeclareFontShape{PU}{pdf}{m}{n}{ <-> cmr10 }{}%
+ \DeclareFontSubstitution{PU}{pdf}{m}{n}%
+ \global\let\HyPsd@LoadUnicode\relax
+}
+\AtBeginDocument{%
+ \ifx\HyPsd@LoadUnicode\relax
+ \else
+ \def\HyPsd@LoadUnicode{%
+ \PackageError{hyperref}{%
+ Unicode support for bookmarks is not available.\MessageBreak
+ Activate unicode support by using one of the options\MessageBreak
+ `unicode', `pdfencoding=unicode', `pdfencoding=auto'\MessageBreak
+ in the preamble%
+ }\@ehc
+ \global\let\HyPsd@LoadUnicode\relax
+ \global\Hy@unicodefalse
+ \global\let\Hy@unicodetrue\Hy@unicodefalse
+ }%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\define@key{Hyp}{pdfencoding}{%
+ \edef\HyPsd@temp{#1}%
+ \ifx\HyPsd@temp\HyPsd@pdfencoding@pdfdoc
+ \let\HyPsd@pdfencoding\HyPsd@temp
+ \Hy@unicodefalse
+ \else
+ \ifcase\ifx\HyPsd@temp\HyPsd@pdfencoding@unicode
+ \z@
+ \else
+ \ifx\HyPsd@temp\HyPsd@pdfencoding@auto
+ \z@
+ \else
+ \@ne
+ \fi
+ \fi
+ \let\HyPsd@pdfencoding\HyPsd@temp
+ \hypersetup{unicode}%
+ \ifHy@unicode
+ \def\HyPsd@pdfencoding{#1}%
+ \ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
+ \HyPsd@LoadStringEnc
+ \fi
+ \else
+ \Hy@Warning{Cannot switch to unicode bookmarks}%
+ \let\HyPsd@pdfencoding\HyPsd@pdfencoding@pdfdoc
+ \fi
+ \else
+ \@onelevel@sanitize\HyPsd@temp
+ \Hy@Warning{%
+ Values of option `pdfencoding':\MessageBreak
+ `pdfdoc', `unicode', `auto'.\MessageBreak
+ Ignoring unknown value `\HyPsd@temp'%
+ }%
+ \fi
+ \fi
+}
+\def\HyPsd@pdfencoding@auto{auto}
+\def\HyPsd@pdfencoding@pdfdoc{pdfdoc}
+\def\HyPsd@pdfencoding@unicode{unicode}
+\let\HyPsd@pdfencoding\Hy@pdfencoding@pdfdoc
+\def\HyPsd@LoadStringEnc{%
+ \RequirePackage{stringenc}[2007/06/14]
+ \let\HyPsd@LoadStringEnc\relax
+}
+\AtBeginDocument{%
+ \@ifpackageloaded{stringenc}{%
+ \let\HyPsd@LoadStringEnc\relax
+ }{%
+ \def\HyPsd@LoadStringEnc{%
+ \Hy@WarningNoLine{%
+ Missing package `stringenc'. Use `pdfencoding=auto'\MessageBreak
+ in the preamble or load the package there%
+ }%
+ }%
+ }%
}
% \end{macrocode}
%
@@ -4674,32 +4779,6 @@
}%
% \end{macrocode}
%
-% If option |unicode| is already processed, then the
-% command \cs{HyPsd@InitUnicode} is cleared after
-% execution. Then the option code only sets
-% the meaning of the switch \cs{ifHy@unicode}.
-% \begin{macrocode}
-\ifx\HyPsd@InitUnicode\relax
- \define@key{Hyp}{unicode}[true]{%
- \Hy@boolkey{unicode}{#1}%
- }%
-\else
- \define@key{Hyp}{unicode}[true]{%
- \Hy@boolkey{unicode}{#1}%
- \ifHy@unicode
- \Hy@WarningNoLine{Set package option `unicode' first\MessageBreak
- in order to load unicode support%
- }%
- \Hy@unicodefalse
- \fi
- }%
-\fi
-% \end{macrocode}
-% The macro \cs{HyPsd@InitUnicode} is no longer needed.
-% \begin{macrocode}
-\let\HyPsd@InitUnicode\@undefined
-% \end{macrocode}
-%
% \subsection{Patch for babel's
% \texorpdfstring{\cs{texttilde}}{\\texttilde}}
% Babel does not define \cmd{\texttilde} in NFSS2 manner,
@@ -6532,8 +6611,25 @@
%
% Start with a fallback for equations
% \begin{macrocode}
-\newcommand\theHequation{\theHsection.\arabic{equation}}
-\@ifundefined{thepart}{}{\newcommand\theHpart{\arabic{part}}}
+\def\Hy@CounterExists#1{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname c@#1\endcsname\relax
+ \expandafter\@gobble
+ \else
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname the#1\endcsname\relax
+ \expandafter\expandafter\expandafter\@gobble
+ \else
+ \expandafter\expandafter\expandafter\@firstofone
+ \fi
+ \fi
+}
+\Hy@CounterExists{section}{%
+ \newcommand\theHequation{\theHsection.\arabic{equation}}%
+}
+\Hy@CounterExists{part}{%
+ \newcommand\theHpart{\arabic{part}}%
+}
\@ifundefined{thechapter}{%
\newcommand\theHsection {\arabic{section}}%
\newcommand\theHfigure {\arabic{figure}}%
@@ -6863,7 +6959,7 @@
#2\@sharp#####4%
}%
}%
- \expandafter\expandafter\expandafter\x\y[#1]{#2}\@nil
+ \expandafter\expandafter\expandafter\x\y[{#1}]{#2}\@nil
% \end{macrocode}
% Patch of \cmd{\LT@start}:
% add anchor before first line after \verb|\vskip\LTpre|
@@ -11332,7 +11428,7 @@
\edef\Hy@temp{#1}%
\ifx\Hy@temp\@empty
\else
- \pdf@addtoks{[#1]\Hy@BorderArrayPatch}{Border}%
+ \pdf@addtoks{[#1]\Hy@BorderArrayPatch}{Border}% hash-ok
\fi
}
\let\Hy@BorderArrayPatch\@empty
@@ -11348,7 +11444,7 @@
\define@key{PDF}{Color}{%
\ifx\relax#1\relax
\else
- \pdf@addtoks{[#1]}{Color}%
+ \pdf@addtoks{[#1]}{Color}% hash-ok
\fi
}
% parameter is a string
@@ -11356,7 +11452,7 @@
% parameter is a integer
\define@key{PDF}{Count}{\pdf@addtoks{#1}{Count}}
% parameter is a array
-\define@key{PDF}{CropBox}{\pdf@addtoks{[#1]}{CropBox}}
+\define@key{PDF}{CropBox}{\pdf@addtoks{[#1]}{CropBox}}% hash-ok
% parameter is a string
\define@key{PDF}{DOSFile}{\pdf@addtoks{(#1)}{DOSFile}}
% parameter is a string or file
@@ -11396,7 +11492,7 @@
\fi
}
% parameter is a string
-\define@key{PDF}{ID}{\pdf@addtoks{[#1]}{ID}}
+\define@key{PDF}{ID}{\pdf@addtoks{[#1]}{ID}}% hash-ok
% parameter is a string
\define@key{PDF}{MacFile}{\pdf@addtoks{(#1)}{MacFile}}
% parameter is a string
@@ -11412,7 +11508,7 @@
% parameter is a string
\define@key{PDF}{Params}{\pdf@addtoks{(#1)}{Params}}
% parameter is a array
-\define@key{PDF}{Rect}{\pdf@addtoks{[#1]}{Rect}}
+\define@key{PDF}{Rect}{\pdf@addtoks{[#1]}{Rect}}% hash-ok
% parameter is a integer
\define@key{PDF}{SrcPg}{\pdf@addtoks{#1}{SrcPg}}
% parameter is a name
@@ -11425,7 +11521,7 @@
% parameter is a string
\define@key{PDF}{UnixFile}{\pdf@addtoks{(#1)}{UnixFile}}
% parameter is an array
-\define@key{PDF}{View}{\pdf@addtoks{[#1]}{View}}
+\define@key{PDF}{View}{\pdf@addtoks{[#1]}{View}}% hash-ok
% parameter is a string
\define@key{PDF}{WinFile}{\pdf@addtoks{(#1)}{WinFile}}
% \end{macrocode}
@@ -14211,7 +14307,7 @@ o\fi,t=#4}%
\begingroup
\escapechar=`\\%
\let\escapechar\@gobble %
- \def\@@BOOKMARK [##1][##2]##3##4##5{\calc@bm@number{##5}}%
+ \def\@@BOOKMARK[##1][##2]##3##4##5{\calc@bm@number{##5}}%
\InputIfFileExists{\jobname.out}{}{}%
\ifx\WriteBookmarks\relax
\global\let\WriteBookmarks\relax
diff --git a/Master/texmf-dist/source/latex/hyperref/nameref.dtx b/Master/texmf-dist/source/latex/hyperref/nameref.dtx
index 891bd49257a..fab18a70baf 100644
--- a/Master/texmf-dist/source/latex/hyperref/nameref.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/nameref.dtx
@@ -300,7 +300,7 @@
\csname beamer@#1\endcsname
\begingroup
\edef\x{\endgroup
- \long\def\expandafter\noexpand\csname beamer@#1\endcsname[####1]{%
+ \long\def\expandafter\noexpand\csname beamer@#1\endcsname[####1]{% hash-ok
\def\noexpand\@currentlabelname{####1}%
\expandafter\noexpand\csname NRorg@beamer@#1\endcsname[{####1}]%
}%