diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/hyperref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/hyperref/hyperref.dtx | 378 |
1 files changed, 277 insertions, 101 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx index 6fb9d3696a7..3fcb559f2f3 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> [2008/04/05 v6.77l +%<!none> [2008/04/12 v6.77m %<package> Hypertext links for LaTeX] %<nohyperref> Dummy hyperref (SR)] %<driver> Hyperref documentation driver file] @@ -116,7 +116,7 @@ \end{document} %</driver> % \fi -% \CheckSum{22061} +% \CheckSum{22290} % % \MakeShortVerb{|} % \StopEventually{} @@ -863,7 +863,7 @@ % converted to the final form. % \end{enumerate} % -% \begin{macro}{\pdfstringdef} +% \begin{macro}{\pdfstringdef} % \cs{pdfstringdef} works on the tokens in |#2| and converts them to % a PDF string as far as possible: % \begin{itemize} @@ -1116,7 +1116,7 @@ % % \paragraph{AMS classes.} % \begin{macrocode} - \HyPSD@AMSclassfix + \HyPsd@AMSclassfix % \end{macrocode} % % \paragraph{Redefinition of \cs{hspace}} @@ -2261,18 +2261,18 @@ % % \begin{macrocode} \@ifundefined{tocsection}{% - \let\HyPSD@AMSclassfix\relax + \let\HyPsd@AMSclassfix\relax }{% - \def\HyPSD@AMSclassfix{% - \let\tocpart\HyPSD@tocsection - \let\tocchapter\HyPSD@tocsection - \let\tocappendix\HyPSD@tocsection - \let\tocsection\HyPSD@tocsection - \let\tocsubsection\HyPSD@tocsection - \let\tocsubsubsection\HyPSD@tocsection - \let\tocparagraph\HyPSD@tocsection + \def\HyPsd@AMSclassfix{% + \let\tocpart\HyPsd@tocsection + \let\tocchapter\HyPsd@tocsection + \let\tocappendix\HyPsd@tocsection + \let\tocsection\HyPsd@tocsection + \let\tocsubsection\HyPsd@tocsection + \let\tocsubsubsection\HyPsd@tocsection + \let\tocparagraph\HyPsd@tocsection }% - \def\HyPSD@tocsection#1#2#3{% + \def\HyPsd@tocsection#1#2#3{% \if @#2@\else\if @#1@\else#1 \fi#2. \fi #3% }% @@ -2984,7 +2984,7 @@ % \end{macro} % % \subsubsection{Replacing tokens} -% \begin{macro}{\HyPsd@Subst} +% \begin{macro}{\HyPsd@Subst} % To save tokens \cs{HyPsd@StringSubst} is an wrapper for the % command \cs{HyPsd@Subst} that does all the work: % In string stored in command |#3| it replaces the tokens @@ -3012,8 +3012,8 @@ }% } % \end{macrocode} -% \end{macro} -% \begin{macro}{\HyPsd@StringSubst} +% \end{macro} +% \begin{macro}{\HyPsd@StringSubst} % To save tokens in \cs{pdfstringdef} \cs{HyPsd@StringSubst} is a wrapper, % that expands argument |#1| before calling \cs{HyPsd@Subst}. % \begin{macrocode} @@ -3021,7 +3021,7 @@ \expandafter\HyPsd@Subst\expandafter{\string#1}% } % \end{macrocode} -% \end{macro} +% \end{macro} % % \subsubsection{Support for package \texttt{xspace}} % \begin{macro}{\HyPsd@doxspace} @@ -3172,11 +3172,21 @@ \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 + \begingroup + \lccode`\~=`^^f4\relax + \lowercase{\endgroup + \def\HyPsd@UTFviii{% + \let\UTFviii@two@octets\HyPsd@UTFviii@two + \let\UTFviii@three@octets\HyPsd@UTFviii@three + \let\UTFviii@four@octets\HyPsd@UTFviii@four + \ifx~\HyPsd@UTFviii@ccxliv@undef + \let~\HyPsd@UTFviii@ccxliv@def + \fi + \let\unichar\HyPsd@unichar + }% }% + \def\HyPsd@UTFviii@ccxliv@undef{\@inpenc@undefined@{utf8}}% + \edef\HyPsd@UTFviii@ccxliv@def{\noexpand\UTFviii@four@octets\string^^f4}% % \end{macrocode} % % The two octet form of UTF-8 |110aaabb| (A) and |10cccddd| (B) @@ -3246,53 +3256,44 @@ }% % \end{macrocode} % -% Four octet form: |11110aab| (A), |10bcccdd| (B), |10deeeff| (C), -% and |10ggghhh| (D). The result are two surrogate characters -% |110010aabbcccddd| and |11001eeeffggghhh|, or as octal numbers -% |\931a\bcd| and |\931e\fgh|. -% The conversion equations: -% \begin{eqnarray} -% a &:= A/2 - 120\\ -% b &:= (isodd(A) ? 2 : 0) + (B/32 - 4)\\ -% c &:= (B - 32*(B/32))/4\\ -% d &:= 2*(B - 4*(B/4)) + (C/32 - 4)\\ -% e &:= (C - 32*(C/32))/4\\ -% f &:= C - 4*C/4\\ -% g &:= D/8 - 16\\ -% h &:= D - 8*(D/8)\\ -% \end{eqnarray} -% ^^A \HyPsd@UTFviii@four/\HyPsd@UTFviii@@four -% ^^A #1 = A (char/number) -% ^^A #2 = B (char) -% ^^A #3 = C (char) -% ^^A #4 = D (char) -% ^^A \HyPsd@UTFviii@@@four -% ^^A #1 = A (number) -% ^^A #2 = B (char) -% ^^A #3 = B/32 (number) -% ^^A #4 = C (char) -% ^^A #5 = C/32 (number) -% ^^A #6 = D (char) -% ^^A #7 = D/8 (number) -% \begin{macrocode} - \def\HyPsd@UTFviii@four#1{% - \expandafter\HyPsd@UTFviii@@four\number`#1|% +% Surrogates: 4 octets in UTF-8, a surrogate pair in UTF-16. +% High surrogate range: U+D800--U+DBFF, low surrogate range: +% U+DC00-U+DFFF. +% +%\begin{quote} +%\begin{verbatim} +%UTF-8: 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx +%wwww = uuuuu - 1 +%UTF-16: 110110ww wwzzzzyy 110111yy yyxxxxxx +%octal: 011 011 0ww 0ww zzz zyy 011 011 1yy 0yy xxx xxx +%\end{verbatim} +%\end{quote} +% \begin{macrocode} + \def\HyPsd@UTFviii@four#1#2{% + \expandafter\HyPsd@@UTFviii@four\number + \numexpr-1+(`#1-240)*4+\dimexpr.0625\dimexpr`#2sp-128sp% + \expandafter|\number + \numexpr`#2-16*\dimexpr.0625\dimexpr`#2sp|% }% - \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{% + \933\number\dimexpr.25\dimexpr#1sp\relax\relax + \csname\number\numexpr#1-4*\dimexpr.25\dimexpr#1sp\endcsname + \ifodd#2 % + \number\numexpr(#2-1)/2\relax + \else + \number\numexpr#2/2\relax + \fi + \number\numexpr\ifodd#2 4+\fi + \dimexpr.0625\dimexpr`#3sp-128sp\relax\relax\relax + \933% + \expandafter\HyPsd@@@UTFviii@four\number + \numexpr`#3-16*\dimexpr.0625\dimexpr`#3sp|% }% - \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@@@UTFviii@four#1|#2{% + \number\numexpr4+\dimexpr.25\dimexpr#1sp\relax\relax\relax + \csname\number\numexpr#1-4*\dimexpr.25\dimexpr#1sp\endcsname + \number\dimexpr.125\dimexpr`#2sp-128sp\relax\relax + \number\numexpr`#2-8*\dimexpr.125\dimexpr`#2sp\relax\relax\relax }% % \end{macrocode} % @@ -4272,28 +4273,163 @@ \def\theoremautorefname{Teorema}% \def\pageautorefname{P\'agina}% } +% \end{macrocode} +% +% Next commented section for Russian is provided by Olga Lapko. +% +% Next follow the checked reference names with commented variants and +% explanations. All they are abbreviated and they won't create a +% grammatical problems in the \emph{middle} of sentences. +% +% The most weak points in these abbreviations are the +% |\equationautorefname|, |\theoremautorefname| and the +% |\FancyVerbLineautorefname|. But those three, and also the +% |\footnoteautorefname| are not \emph{too} often referenced. +% Another rather weak point is the |\appendixautorefname|. +% \begin{macrocode} \def\HyLang@russian{% - \def\equationautorefname{% - \cyr\cyrv\cyrery\cyrr\cyra\cyrzh\cyre\cyrn\cyri\cyre - }% +% \end{macrocode} +% The abbreviated reference to the equation: +% it is not for ``the good face of the book'', but maybe it will be +% better to get the company for the |\theoremautorefname|? +% \begin{macrocode} + \def\equationautorefname{\cyr\cyrv\cyrery\cyrr.}% +% \end{macrocode} +% The name of the equation reference has common form for both +% nominative and accusative but changes in other forms, like +% ``of |\autoref{auto}|'' etc. The full name must follow full +% name of the |\theoremautorefname|. +% \begin{macrocode} +% \def\equationautorefname{% +% \cyr\cyrv\cyrery\cyrr\cyra\cyrzh\cyre\cyrn\cyri\cyre +% }% +% \end{macrocode} +% +% The variant of footnote has abbreviation form of the synonym +% of the word ``footnote''. This variant of abbreviated synonym +% has alternative status (maybe obsolete?). +% \begin{macrocode} \def\footnoteautorefname{% \cyr\cyrp\cyro\cyrd\cyrs\cyrt\cyrr.\ \cyrp\cyrr\cyri\cyrm.% }% +% \end{macrocode} +% Commented form of the full synonym for ``footnote''. +% It has common form for both nominative and accusative but +% changes in other forms, like ``of |\autoref{auto}|'' +% \begin{macrocode} +% \def\footnoteautorefname{% +% \cyr\cyrp\cyro\cyrd\cyrs\cyrt\cyrr\cyro\cyrch\cyrn\cyro\cyre\ % +% \cyrp\cyrr\cyri\cyrm\cyre\cyrch\cyra\cyrn\cyri\cyre +% }% +% \end{macrocode} +% Commented forms of the ``footnote'': have different forms, the +% same is for the nominative and accusative. (The others needed?) +% \begin{macrocode} +% \def\Nomfootnoteautorefname{\cyr\cyrs\cyrn\cyro\cyrs\cyrk\cyra}% +% \def\Accfootnoteautorefname{\cyr\cyrs\cyrn\cyro\cyrs\cyrk\cyru}% +% \end{macrocode} +% +% Name of the list item, can be confused with the paragraph +% reference name, but reader could understand meaning from context(?). +% Commented variant has common form for both nominative and accusative +% but changes in other forms, like ``of |\autoref{auto}|'' etc. +% \begin{macrocode} \def\itemautorefname{\cyr\cyrp.}% +% \def\itemautorefname{\cyr\cyrp\cyru\cyrn\cyrk\cyrt}% +% \end{macrocode} +% +% Names of the figure and table have stable (standard) abbreviation +% forms. No problem in the middle of sentence. +% \begin{macrocode} \def\figureautorefname{\cyr\cyrr\cyri\cyrs.}% \def\tableautorefname{\cyr\cyrt\cyra\cyrb\cyrl.}% +% \end{macrocode} +% +% Names of the part, chapter, section(s) have stable (standard) +% abbreviation forms. No problem in the middle of sentence. +% \begin{macrocode} \def\partautorefname{\cyr\cyrch.}% - \def\appendixautorefname{\cyr\cyrp\cyrr\cyri\cyrl.}% \def\chapterautorefname{\cyr\cyrg\cyrl.}% \def\sectionautorefname{\cyr\cyrr\cyra\cyrz\cyrd.}% +% \end{macrocode} +% +% Name of the appendix can use this abbreviation, but it is not +% standard for books, i.e, not for ``the good face of the book''. +% Commented variant has common form for both nominative and +% accusative but changes in other forms, like ``of +% |\autoref{auto}|'' etc. +% \begin{macrocode} + \def\appendixautorefname{\cyr\cyrp\cyrr\cyri\cyrl.}% +% \def\appendixautorefname{% +% \cyr\cyrp\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre +% }% +% \end{macrocode} +% +% The sectioning command have stable (almost standard) and common +% abbreviation form for all levels (the meaning of these references +% visible from the section number). No problem. +% \begin{macrocode} \def\subsectionautorefname{\cyr\cyrr\cyra\cyrz\cyrd.}% \def\subsubsectionautorefname{\cyr\cyrr\cyra\cyrz\cyrd.}% +% \end{macrocode} +% +% The names of references to paragraphs also have stable +% (almost standard) and common abbreviation form for all +% levels (the meaning of these references is visible from +% the section number). No problem in the middle of sentence. +% \begin{macrocode} \def\paragraphautorefname{\cyr\cyrp.}% \def\subparagraphautorefname{\cyr\cyrp.}% - \def\FancyVerbLineautorefname{\cyr\cyrs\cyrt\cyrr\cyro\cyrk\cyra}% - \def\theoremautorefname{\cyr\cyrt\cyre\cyro\cyrr\cyre\cyrm\cyra}% +% \end{macrocode} +% Commented variant can be used in books but since it +% has common form for both nominative and accusative but it +% changes in other forms, like ``of |\autoref{auto}|'' etc. +% \begin{macrocode} +% \def\paragraphautorefname{\cyr\cyrp\cyru\cyrn\cyrk\cyrt}% +% \def\subparagraphautorefname{\cyr\cyrp\cyru\cyrn\cyrk\cyrt}% +% \end{macrocode} +% +% The name of verbatim line. Here could be a standard of the +% abbreviation (used very rare). But the author preprint +% publications (which have not any editor or corrector) +% can use this abbreviation for the page reference. So the +% meaning of the line reference can be read as reference to +% the page. +% \begin{macrocode} + \def\FancyVerbLineautorefname{\cyr\cyrs\cyrt\cyrr.}% +% \end{macrocode} +% Commented names of the ``verbatim line'': have different forms, +% also the nominative and accusative. +% \begin{macrocode} +% \def\NomFancyVerbLineautorefname{\cyr\cyrs\cyrt\cyrr\cyro\cyrk\cyra}% +% \def\AccFancyVerbLineautorefname{\cyr\cyrs\cyrt\cyrr\cyro\cyrk\cyru}% +% \end{macrocode} +% The alternative, ve-e-e-ery professional abbreviation, +% was used in typography markup for typesetters. +% \begin{macrocode} +% \def\FancyVerbLineautorefname{\cyr\cyrs\cyrt\cyrr\cyrk.}% +% \end{macrocode} +% +% The names of theorem: if we want have ``the good face of +% the book'', so the theorem reference must have the full name +% (like equation reference). But \ldots +% \begin{macrocode} + \def\theoremautorefname{\cyr\cyrt\cyre\cyro\cyrr.}% +% \end{macrocode} +% Commented forms of the ``theorem'': have different forms, also +% the nominative and accusative. +% \begin{macrocode} +% \def\Nomtheoremautorefname{\cyr\cyrt\cyre\cyro\cyrr\cyre\cyrm\cyra}% +% \def\Acctheoremautorefname{\cyr\cyrt\cyre\cyro\cyrr\cyre\cyrm\cyru}% +% \end{macrocode} +% +% Name of the page stable (standard) abbreviation form. No problem. +% \begin{macrocode} \def\pageautorefname{\cyr\cyrs.}% } +% \end{macrocode} +% +% \begin{macrocode} \def\HyLang@spanish{% \def\equationautorefname{Ecuaci\'on}% \def\footnoteautorefname{Nota a pie de p\'agina}% @@ -4353,7 +4489,7 @@ % \end{macrocode} % % \begin{macrocode} -\def\HyLang@DeclareLang#1#2{% +\def\HyLang@DeclareLang#1#2#3{% \begingroup \edef\x##1##2{% \noexpand\ifx##2\relax @@ -4362,34 +4498,35 @@ \endgroup \noexpand\define@key{Hyp}{#1}[]{% \noexpand\HyLang@addto{\noexpand##1}{\noexpand##2}% + #3% }% }% \expandafter\x\csname extras#1\expandafter\endcsname \csname HyLang@#2\endcsname } -\HyLang@DeclareLang{english}{english} -\HyLang@DeclareLang{UKenglish}{english} -\HyLang@DeclareLang{british}{english} -\HyLang@DeclareLang{USenglish}{english} -\HyLang@DeclareLang{american}{english} -\HyLang@DeclareLang{german}{german} -\HyLang@DeclareLang{austrian}{german} -\HyLang@DeclareLang{ngerman}{german} -\HyLang@DeclareLang{naustrian}{german} -\HyLang@DeclareLang{russian}{russian} -\HyLang@DeclareLang{brazil}{portuges} -\HyLang@DeclareLang{brazilian}{portuges} -\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} -\HyLang@DeclareLang{italian}{italian} -\HyLang@DeclareLang{magyar}{magyar} -\HyLang@DeclareLang{hungarian}{magyar} +\HyLang@DeclareLang{english}{english}{} +\HyLang@DeclareLang{UKenglish}{english}{} +\HyLang@DeclareLang{british}{english}{} +\HyLang@DeclareLang{USenglish}{english}{} +\HyLang@DeclareLang{american}{english}{} +\HyLang@DeclareLang{german}{german}{} +\HyLang@DeclareLang{austrian}{german}{} +\HyLang@DeclareLang{ngerman}{german}{} +\HyLang@DeclareLang{naustrian}{german}{} +\HyLang@DeclareLang{russian}{russian}{\noexpand\hypersetup{unicode}} +\HyLang@DeclareLang{brazil}{portuges}{} +\HyLang@DeclareLang{brazilian}{portuges}{} +\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}{} +\HyLang@DeclareLang{italian}{italian}{} +\HyLang@DeclareLang{magyar}{magyar}{} +\HyLang@DeclareLang{hungarian}{magyar}{} % \end{macrocode} % More work is needed in case of options |vietnamese| and |vietnam|. % \begin{macrocode} @@ -4729,8 +4866,18 @@ \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}{pdfcreationdate}{% + \begingroup + \Hy@unicodefalse + \pdfstringdef\@pdfcreationdate{#1}% + \endgroup +} +\define@key{Hyp}{pdfmoddate}{% + \begingroup + \Hy@unicodefalse + \pdfstringdef\@pdfmoddate{#1}% + \endgroup +} \define@key{Hyp}{pdfsubject}{\pdfstringdef\@pdfsubject{#1}} \define@key{Hyp}{pdfkeywords}{\pdfstringdef\@pdfkeywords{#1}} \define@key{Hyp}{pdfview}{\calculate@pdfview#1 \\} @@ -7487,6 +7634,7 @@ \if@hyper@item \stepcounter{Item}% \hyper@refstepcounter{Item}% + \@hyper@itemfalse \else \hyper@refstepcounter{#1}% \fi @@ -8037,8 +8185,7 @@ % \verb+\footnotemark+ and a call of \verb+\footnotetext+ % with the optional argument, that is not supported % by hyperref. The result is a link by \verb+\footnotemark+ -% without valid anchor. -% +% without valid anchor % \begin{macrocode} \@ifpackageloaded{longtable}{% \CheckCommand*{\LT@p@ftntext}[1]{% @@ -8087,6 +8234,35 @@ }{}% % \end{macrocode} % +% Footnotes for fancyvrb (Fix by Manuel P\'egouri\'e-Gonnard). +% \begin{macrocode} + \@ifpackageloaded{fancyvrb}{% + \def\V@@footnotetext{% + \insert\footins\bgroup + \csname reset@font\endcsname + \footnotesize + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth\dp\strutbox + \floatingpenalty \@MM + \hsize\columnwidth + \@parboxrestore + \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}% + \@makefntext{}% + \rule{\z@}{\footnotesep}% + \bgroup + \aftergroup\V@@@footnotetext + \Hy@raisedlink{% + \hyper@@anchor{\Hy@footnote@currentHref}{\relax}% + }% + \let\@currentHlabel\Hy@footnote@currentHlabel + \let\@currentHref\Hy@footnote@currentHref + \let\@currentlabelname\@empty + \ignorespaces + }% + }{}% +% \end{macrocode} +% % But the special footnotes % in |\maketitle| are much too hard to deal with % properly. Let them revert to plain behaviour. |