From 500af65c59a551d272e65a1a8591f9e5e1132281 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 15 Jan 2010 00:23:50 +0000 Subject: hyperref update (13jan10) git-svn-id: svn://tug.org/texlive/trunk@16720 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/hyperref/doc/manual.tex | 44 ++++- .../source/latex/hyperref/doc/options.tex | 2 + .../texmf-dist/source/latex/hyperref/hyperref.dtx | 219 +++++++++++++++++++-- 3 files changed, 243 insertions(+), 22 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/hyperref/doc/manual.tex b/Master/texmf-dist/source/latex/hyperref/doc/manual.tex index cd572f4357f..577f8078fcd 100644 --- a/Master/texmf-dist/source/latex/hyperref/doc/manual.tex +++ b/Master/texmf-dist/source/latex/hyperref/doc/manual.tex @@ -11,9 +11,11 @@ % % Manual updates: % * Steve Peter and Karl Berry, 7/03. -% * Heiko Oberdiek, 2006-2009. +% * Heiko Oberdiek, 2006-2010. % +\def\mydate{January 2010} + \RequirePackage{ifpdf} \ifpdf % We are running pdfTeX in pdf mode \documentclass[pdftex]{article} @@ -24,6 +26,7 @@ \usepackage{etex}% for \eTeX \usepackage{pifont} +\usepackage{calc} \newcommand*{\cs}[1]{% \texttt{\textbackslash #1}% @@ -131,7 +134,7 @@ \title{Hypertext marks in \LaTeX: a manual for \textsf{hyperref}} \author{Sebastian Rahtz \and Heiko Oberdiek} -\date{December 2009} +\date{\mydate} \begin{document} @@ -493,7 +496,7 @@ next \TeX\ run if it is edited to contain the line \\ \end{verbatim} \subsection{PDF display and information options} -\noindent\begin{longtable}{>{\ttfamily}ll>{\itshape}lp{6cm}} +\noindent\begin{longtable}{@{}>{\ttfamily}l>{\raggedright}p{\widthof{key value}}>{\itshape}lp{7cm}@{}} baseurl & URL & & Sets the base URL of the PDF document \\ pdfpagemode & text & empty & Determines how the file is opening in Acrobat; the possibilities are \texttt{UseNone}, \texttt{UseThumbs} (show thumbnails), \texttt{UseOutlines} @@ -506,6 +509,11 @@ pdfsubject & text & & Sets the document information Subject fie pdfcreator & text & & Sets the document information Creator field \\ pdfproducer & text & & Sets the document information Producer field \\ pdfkeywords & text & & Sets the document information Keywords field \\ +pdftrapped & text & empty & Sets the document information Trapped entry.\\ +&&& Possible values are \texttt{True}, \texttt{False} and \texttt{Unknown}.\\ +&&& An empty value means, the entry is not set.\\ +pdfinfo & key value list & empty & Alternative interface for setting the + document information.\\ pdfview & text & XYZ & Sets the default PDF `view' for each link \\ pdfstartpage & text & 1 & Determines on which page the PDF file is opened. \\ pdfstartview & text & Fit & Set the startup page view \\ @@ -596,12 +604,36 @@ Split & /Dm /M & Two lines sweep across the screen to reveal the new page. \\ Wipe & /Di & A single line sweeps across the screen to reveal the new page. \end{longtable} +\subsection{Option \texttt{pdfinfo}} + +The information entries can be set using \texttt{pdftitle}, +\texttt{pdfsubject}, \dots. Option \texttt{pdfinfo} provides an alternative +interface. It takes a key value list. The key names are the names that +appear in the PDF information dictionary directly. Known keys such as +\texttt{Title}, \texttt{Subject}, \texttt{Trapped} and other are mapped to +options \texttt{pdftitle}, \texttt{subject}, \texttt{trapped}, \dots +Unknown keys are added to the information dictionary. Their values are text +strings (see PDF specification). +Example: +\begin{quote} +\begin{verbatim} +\hypersetup{ + pdfinfo={ + Title={My Title}, + Subject={My Subject}, + NewKey={Foobar}, + % ... + } +} +\end{verbatim} +\end{quote} + \subsection{Big alphabetical list} The following is a complete listing of available options for \textsf{hyperref}, arranged alphabetically. -\noindent\begin{longtable}{>{\ttfamily}llp{6cm}} +\noindent\begin{longtable}{@{}>{\ttfamily}llp{7cm}@{}} anchorcolor & \textit{black} & set color of anchors \\ backref & \textit{false} & do bibliographical back references \\ baseurl & \textit{empty} & set base URL for document \\ @@ -662,6 +694,7 @@ pdfduplex & \textit{empty} & paper handling option for print dialog\\ pdffitwindow & \textit{false} & resize document window to fit document size \\ pdfhighlight & \textit{/I} & set highlighting of PDF links \\ +pdfinfo & \textit{empty} & alternative interface for setting document information\\ pdfkeywords & \textit{empty} & text for PDF Keywords field \\ pdflang & \textit{empty} & PDF language identifier (RFC 3066) \\ pdfmark & \textit{false} & an alias for \textsf{dvips} \\ @@ -690,6 +723,9 @@ pdfsubject & \textit{empty} & text for PDF Subject field \\ pdftex & & use \textsf{pdf\TeX} backend \\ pdftitle & \textit{empty} & text for PDF Title field \\ pdftoolbar & \textit{true} & make PDF toolbar visible \\ +pdftrapped & \textit{empty} & Sets the document information Trapped entry. + Possible values are \texttt{True}, \texttt{False} and \texttt{Unknown}. + An empty value means, the entry is not set.\\ pdfview & \textit{XYZ} & PDF `view' when on link traversal \\ pdfviewarea & \textit{empty} & set /ViewArea of viewer preferences \\ pdfviewclip & \textit{empty} & set /ViewClip of viewer preferences \\ diff --git a/Master/texmf-dist/source/latex/hyperref/doc/options.tex b/Master/texmf-dist/source/latex/hyperref/doc/options.tex index 4f2f47dd368..04f14859f9b 100644 --- a/Master/texmf-dist/source/latex/hyperref/doc/options.tex +++ b/Master/texmf-dist/source/latex/hyperref/doc/options.tex @@ -72,6 +72,7 @@ pdfdisplaydoctitle &display document title instead of file name in title bar&fal pdfduplex &paper handling option for print dialog& \optempty\\ pdffitwindow &resize document window to fit document size&false\\ pdfhighlight &set highlighting of PDF links& /I\\ +pdfinfo & alternative interface for document information & \optempty\\ pdfkeywords &text for PDF Keywords field&\optempty\\ pdflang &PDF language identifier (RFC 3066)&\optempty\\ pdfmenubar &make PDF viewer's menu bar visible&true\\ @@ -89,6 +90,7 @@ pdfprintclip &set /PrintClip of viewer preferences&\optempty\\ pdfprintpagerange &set /PrintPageRange of viewer preferences&\optempty\\ pdfprintscaling &page scaling option for print dialog&\optempty\\ pdfproducer &text for PDF Producer field&\optempty\\ +pdftrapped & set the document information Trapped entry&\optempty\\ pdfstartpage &page at which PDF document opens&1\\ pdfstartview &starting view of PDF document& /Fit\\ pdfsubject &text for PDF Subject field&\optempty\\ diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx index fe98b953c56..dd0a946c1a0 100644 --- a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx +++ b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx @@ -39,7 +39,7 @@ %\ProvidesFile{puenc.def} %\ProvidesFile{puvnenc.def} %\ProvidesFile{puarenc.def} -% [2010/01/08 v6.80a +% [2010/01/11 v6.80b % Hypertext links for LaTeX] % Dummy hyperref (SR)] % Hyperref documentation driver file] @@ -119,7 +119,7 @@ \end{document} % % \fi -% \CheckSum{25220} +% \CheckSum{25445} % % \MakeShortVerb{|} % \StopEventually{} @@ -559,6 +559,8 @@ % with the later releases! % \begin{macrocode} \RequirePackage{keyval}[1997/11/10] +\RequirePackage{kvsetkeys}[2007/09/29] +\RequirePackage{pdfescape}[2007/11/11] \RequirePackage{ifpdf}[2006/02/20] \RequirePackage{ifvtex} \RequirePackage{ifxetex}[2006/08/21] @@ -4421,7 +4423,13 @@ \define@key{Hyp}{dviwindo}[true]{% \def\Hy@driver{hdviwind}% \setkeys{Hyp}{colorlinks}% - \PassOptionsToPackage{dviwindo}{color}% + \ifpdf + \else + \ifxetex + \else + \PassOptionsToPackage{dviwindo}{color}% + \fi + \fi } \define@key{Hyp}{dvipsone}[true]{% \def\Hy@driver{hdvipson}% @@ -5281,6 +5289,8 @@ \do{4}{four copies}% \do{5}{five copies}% } +% \end{macrocode} +% \begin{macrocode} \define@key{Hyp}{pdfusetitle}[true]{% \Hy@boolkey[pdfusetitle]{usetitle}{#1}% } @@ -5340,6 +5350,132 @@ \HyPsd@XeTeXBigCharstrue \pdfstringdef\@pdfkeywords{#1}% } +\define@key{Hyp}{pdftrapped}{% + \lowercase{\edef\Hy@temp{#1}}% + \ifx\Hy@temp\HyInfo@trapped@true + \def\@pdftrapped{True}% + \else + \ifx\Hy@temp\HyInfo@trapped@false + \def\@pdftrapped{False}% + \else + \ifx\Hy@temp\HyInfo@trapped@unknown + \def\@pdftrapped{Unknown}% + \else + \ifx\Hy@temp\@empty + \else + \Hy@Warning{% + Unsupported value `#1'\MessageBreak + for option `pdftrapped'% + }% + \fi + \def\@pdftrapped{}% + \fi + \fi + \fi +} +\def\HyInfo@trapped@true{true} +\def\HyInfo@trapped@false{false} +\def\HyInfo@trapped@unknown{unknown} +\def\HyInfo@TrappedUnsupported{% + \ifx\@pdftrapped\@empty + \else + \Hy@WarningNoLine{`pdftrapped' is not supported by this driver}% + \gdef\HyInfo@TrappedUnsupported{}% + \fi +} +\define@key{Hyp}{pdfinfo}{% + \kvsetkeys{pdfinfo}{#1}% +} +\def\Hy@temp#1{% + \lowercase{\Hy@temp@A{#1}}{#1}% +} +\def\Hy@temp@A#1#2{% + \define@key{pdfinfo}{#2}{% + \hypersetup{pdf#1={##1}}% + }% +} +\Hy@temp{Title} +\Hy@temp{Author} +\Hy@temp{Keywords} +\Hy@temp{Subject} +\Hy@temp{Creator} +\Hy@temp{Producer} +\Hy@temp{CreationDate} +\Hy@temp{ModDate} +\Hy@temp{Trapped} +\newif\ifHyInfo@AddonUnsupported +\kv@set@family@handler{pdfinfo}{% + \HyInfo@AddonHandler{#1}{#2}% +} +\let\HyInfo@do\relax +\def\HyInfo@AddonHandler#1#2{% + \ifx\kv@value\relax + \Hy@Warning{% + Option `pdfinfo': ignoring key `\kv@key' without value% + }% + \else + \EdefEscapeName\HyInfo@KeyEscaped{\kv@key}% + \EdefUnescapeName\HyInfo@Key{\HyInfo@KeyEscaped}% + \expandafter\ifx\csname KV@pdfinfo@\HyInfo@Key\endcsname\relax + \ifHyInfo@AddonUnsupported + \Hy@Warning{% + This driver does not support additional\MessageBreak + information entries, therefore\MessageBreak + `\kv@key' is ignored% + }% + \else + \define@key{pdfinfo}{\HyInfo@Key}{% + \HyXeTeX@CheckUnicode + \HyPsd@XeTeXBigCharstrue + \pdfstringdef\HyInfo@Value{##1}% + \expandafter\let\csname HyInfo@Value@\HyInfo@Key\endcsname + \HyInfo@Value + }% + \edef\HyInfo@AddonList{% + \HyInfo@AddonList + \HyInfo@do{\HyInfo@Key}% + }% + \kv@parse@normalized{% + \HyInfo@Key={#2}% + }{% + \kv@processor@default{pdfinfo}% + }% + \fi + \else + \kv@parse@normalized{% + \HyInfo@Key={#2}% + }{% + \kv@processor@default{pdfinfo}% + }% + \fi + \fi +} +\def\HyInfo@GenerateAddons{% + \ifHyInfo@AddonUnsupported + \def\HyInfo@Addons{}% + \else + \begingroup + \toks@{}% + \def\HyInfo@do##1{% + \EdefEscapeName\HyInfo@Key{##1}% + \edef\x{% + \toks@{% + \the\toks@ + /\HyInfo@Key(\csname HyInfo@Value@##1\endcsname)% + }% + }% + \x + }% + \HyInfo@AddonList + \edef\x{\endgroup + \def\noexpand\HyInfo@Addons{\the\toks@}% + }% + \x + \fi +} +\def\HyInfo@AddonList{} +% \end{macrocode} +% \begin{macrocode} \define@key{Hyp}{pdfview}{\calculate@pdfview#1 \\} \define@key{Hyp}{pdflinkmargin}{\setpdflinkmargin{#1}} \let\setpdflinkmargin\@gobble @@ -5447,6 +5583,7 @@ \def\@pdfmoddate{} \def\@pdfsubject{} \def\@pdfkeywords{} +\def\@pdftrapped{} \def\@pdfpagescrop{} \def\@pdfstartview{ /Fit } \def\@pdfstartpage{1} @@ -6978,9 +7115,6 @@ % % \subsection{Choice field} % -% \begin{macrocode} -\RequirePackage{kvsetkeys}[2007/09/29] -% \end{macrocode} % \begin{macro}{\HyField@PDFChoices} % |#1|: list of choices in key value syntax, key = exported name, % value = displayed text.\\ @@ -8242,19 +8376,21 @@ % \begin{macrocode} %<*pdfmarkbase> \begingroup - \toks@\expandafter{\Hy@FirstPageHook}% - \xdef\Hy@FirstPageHook{% - \noexpand\headerps@out{% - systemdict /pdfmark known% - {% - userdict /?pdfmark systemdict /exec get put% - }{% - userdict /?pdfmark systemdict /pop get put % - userdict /pdfmark systemdict /cleartomark get put% + \@ifundefined{headerps@out}{}{% + \toks@\expandafter{\Hy@FirstPageHook}% + \xdef\Hy@FirstPageHook{% + \noexpand\headerps@out{% + systemdict /pdfmark known% + {% + userdict /?pdfmark systemdict /exec get put% + }{% + userdict /?pdfmark systemdict /pop get put % + userdict /pdfmark systemdict /cleartomark get put% + }% + ifelse% }% - ifelse% + \the\toks@ }% - \the\toks@ }% \endgroup % @@ -11321,6 +11457,7 @@ % \begin{macrocode} \def\PDF@FinishDoc{% \Hy@UseMaketitleInfos + \HyInfo@GenerateAddons \pdfinfo{% /Author(\@pdfauthor)% /Title(\@pdftitle)% @@ -11339,6 +11476,11 @@ /Producer(\@pdfproducer)% \fi /Keywords(\@pdfkeywords)% + \ifx\@pdftrapped\@empty + \else + /Trapped/\@pdftrapped + \fi + \HyInfo@Addons }% \Hy@DisableOption{pdfauthor}% \Hy@DisableOption{pdftitle}% @@ -11348,6 +11490,8 @@ \Hy@DisableOption{pdfmoddate}% \Hy@DisableOption{pdfproducer}% \Hy@DisableOption{pdfkeywords}% + \Hy@DisableOption{pdftrapped}% + \Hy@DisableOption{pdfinfo}% } % \end{macrocode} % \end{macro} @@ -11897,8 +12041,10 @@ \ifx\@pdfproducer\relax \def\@pdfproducer{dviwindo + Distiller}% \fi +\HyInfo@AddonUnsupportedtrue \def\PDF@FinishDoc{% \Hy@UseMaketitleInfos + \HyInfo@TrappedUnsupported \special{PDF: Keywords \@pdfkeywords}% \special{PDF: Title \@pdftitle}% \special{PDF: Creator \@pdfcreator}% @@ -11924,6 +12070,8 @@ \Hy@DisableOption{pdfmoddate}% \Hy@DisableOption{pdfproducer}% \Hy@DisableOption{pdfkeywords}% + \Hy@DisableOption{pdftrapped}% + \Hy@DisableOption{pdfinfo}% } \def\PDF@SetupDoc{% \ifx\@baseurl\@empty @@ -12341,6 +12489,7 @@ \fi \def\PDF@FinishDoc{% \Hy@UseMaketitleInfos + \HyInfo@GenerateAddons \@pdfm@mark{% docinfo<<% /Title(\@pdftitle)% @@ -12360,6 +12509,11 @@ /Producer(\@pdfproducer)% \fi /Keywords(\@pdfkeywords)% + \ifx\@pdftrapped\@empty + \else + /Trapped/\@pdftrapped + \fi + \HyInfo@Addons >>% }% \Hy@DisableOption{pdfauthor}% @@ -12370,6 +12524,8 @@ \Hy@DisableOption{pdfmoddate}% \Hy@DisableOption{pdfproducer}% \Hy@DisableOption{pdfkeywords}% + \Hy@DisableOption{pdftrapped}% + \Hy@DisableOption{pdfinfo}% } % \end{macrocode} % \begin{macrocode} @@ -13174,8 +13330,10 @@ \special{!pdfinfo l=}% \fi }% +\HyInfo@AddonUnsupportedtrue \def\PDF@FinishDoc{% \Hy@UseMaketitleInfos + \HyInfo@TrappedUnsupported \special{!pdfinfo a=<\@pdfauthor>}% \special{!pdfinfo t=<\@pdftitle>}% \special{!pdfinfo s=<\@pdfsubject>}% @@ -13193,6 +13351,8 @@ \Hy@DisableOption{pdfmoddate}% \Hy@DisableOption{pdfproducer}% \Hy@DisableOption{pdfkeywords}% + \Hy@DisableOption{pdftrapped}% + \Hy@DisableOption{pdfinfo}% } % % \end{macrocode} @@ -13461,6 +13621,7 @@ \newtoks\pdf@docset \def\PDF@FinishDoc{% \Hy@UseMaketitleInfos + \HyInfo@GenerateAddons \let\Hy@temp\@empty \ifx\@pdfcreationdate\@empty \else @@ -13488,8 +13649,16 @@ Subject=\@pdfsubject,% Creator=\@pdfcreator,% Author=\@pdfauthor,% - Keywords=\@pdfkeywords + Keywords=\@pdfkeywords,% + Trapped=\@pdftrapped }% + \ifx\HyInfo@Addons\@empty + \else + \pdfmark{% + pdfmark=/DOCINFO,% + Raw={\HyInfo@Addons}% + }% + \fi \Hy@DisableOption{pdfauthor}% \Hy@DisableOption{pdftitle}% \Hy@DisableOption{pdfsubject}% @@ -13498,6 +13667,8 @@ \Hy@DisableOption{pdfmoddate}% \Hy@DisableOption{pdfproducer}% \Hy@DisableOption{pdfkeywords}% + \Hy@DisableOption{pdftrapped}% + \Hy@DisableOption{pdfinfo}% } \def\PDF@SetupDoc{% \def\Hy@temp{}% @@ -13836,6 +14007,14 @@ \define@key{PDF}{ModDate}{\pdf@addtoks{(#1)}{ModDate}} \define@key{PDF}{Base}{\pdf@addtoks{(#1)}{Base}} \define@key{PDF}{URI}{\pdf@addtoks{#1}{URI}} +\define@key{PDF}{Trapped}{% + \edef\Hy@temp{#1}% + \ifx\Hy@temp\@empty + \else + \pdf@addtoks{/#1}{Trapped}% + \fi +} + % %<*pdfmark> \def\Acrobatmenu#1#2{% @@ -14483,8 +14662,10 @@ \ifx\@pdfproducer\relax \def\@pdfproducer{dvipsone + Distiller}% \fi +\HyInfo@AddonUnsupportedtrue \def\PDF@FinishDoc{% \Hy@UseMaketitleInfos + \HyInfo@TrappedUnsupported \special{PDF: Keywords \@pdfkeywords}% \special{PDF: Title \@pdftitle}% \special{PDF: Creator \@pdfcreator}% @@ -14510,6 +14691,8 @@ \Hy@DisableOption{pdfmoddate}% \Hy@DisableOption{pdfproducer}% \Hy@DisableOption{pdfkeywords}% + \Hy@DisableOption{pdftrapped}% + \Hy@DisableOption{pdfinfo}% } \def\PDF@SetupDoc{% \def\Hy@temp{}% -- cgit v1.2.3