diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-06 23:25:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-06 23:25:18 +0000 |
commit | 9f12275c15f0ed5950fb4f3101bd3a9eb8cce969 (patch) | |
tree | d603c9a35d23a94e2650eaa2ff2c84a98d94a889 /Master/texmf-dist/tex/latex | |
parent | 6c7ac04da0ed0c0bcf3f63106addbd66c35d7388 (diff) |
hypdvips (6dec11)
git-svn-id: svn://tug.org/texlive/trunk@24781 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty | 138 |
1 files changed, 94 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty b/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty index 639b103d259..f2df149d94c 100644 --- a/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty +++ b/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{hypdvips} - [2011/06/07 v2.03 + [2011/12/06 v2.04 Hyperref extensions for use with dvips] \@ifpackageloaded{hyperref} { @@ -41,9 +41,9 @@ \ProcessOptions \endinput } +\RequirePackage{atveryend} \RequirePackage{xcolor} \RequirePackage{xkeyval} -\RequirePackage[totpages]{zref} \@ifpackageloaded{bookmark} { \PackageWarning{hypdvips}{Package `bookmark' should not be loaded before\MessageBreak hypdvips.\MessageBreak}% @@ -60,32 +60,26 @@ \let\special\pp@backup@special } \@ifpackageloaded{caption}{}{ - \RequirePackage{hypcap} - \renewcommand{\capstart}{% - \ifcapstart - \H@refstepcounter\@captype % first part of caption - \hyper@makecurrent{\@captype} - \global\let\hc@currentHref\@currentHref - \vspace*{-\hypcapspace}% - \begingroup - \let\leavevmode\relax - \pp@SDictPS{/pdf@hoff 0 /pdf@voff 0 pp.savecurrentpoint} - \ifHy@draft% - \else% - \pdfmark{% - pdfmark=/DEST,% - linktype=anchor,% - View={/\@pdfview \@pdfviewparams},% - Dest={\@currentHref}% - }% - \fi% - \endgroup - \vspace*{\hypcapspace}% - \hc@hyperref{\let\caption\hc@caption}% - \global\@capstarttrue - \global\advance\csname c@\@captype\endcsname\m@ne - \fi - } + \RequirePackage[all]{hypcap} + \@ifpackageloaded{wrapfig}{% + \let\pp@backup@WF@rapt\WF@rapt + \def\WF@rapt[#1]#2{% final two args: #1 = overhang, #2 = width, + \gdef\WF@ovh{#1}% hold overhang for later, when \width is known + \global\setbox\WF@box\vtop\bgroup \setlength\hsize{#2}% + \capstart + \ifdim\hsize>\z@ \@parboxrestore \else + \setbox\z@\hbox\bgroup \let\wf@@caption\caption \let\caption\wf@caption + \ignorespaces \fi} + \let\hc@orgendwrapfigure\endwrapfigure + \def\endwrapfigure{% + \if@capstart + \PackageError{hypcap}{You have forgotten to use \string\caption}% + \global\@capstartfalse + \else + \fi + \hc@orgendwrapfigure% + }% + }{} } \ifHy@unicode \else @@ -876,7 +870,7 @@ } def /pp.getlasterror % returns: string { - [(\string\(PostScript\string\256 error: /) (\string\044error) cvx exec /errorname get pp.cvs (\string\))] pp.concat + [(\string\(PostScript\string\256 language error: /) (\string\044error) cvx exec /errorname get pp.cvs (\string\))] pp.concat } def /pp.warning % argument: string { @@ -1948,7 +1942,7 @@ pp.globaldict /pp.errcount get dup 0 gt {dup pp.cvs exch 1 eq {( error)} {( errors)} ifelse} {pop} ifelse pp.globaldict /pp.errcount get 0 gt pp.globaldict /pp.warncount get 0 gt and {( and )} if pp.globaldict /pp.warncount get dup 0 gt {dup pp.cvs exch 1 eq {( warning)} {( warnings)} ifelse} {pop} ifelse - (\string\n during processing of this PostScript\string\256 file.) + (\string\n during processing of this PostScript\string\256 language file.) ] pp.concat pp.println } if @@ -2262,9 +2256,9 @@ } \let\pp@backup@@footnotetext\@footnotetext \renewcommand{\@footnotetext}[1]{% - \let\pp@saved@beforefootnote@cref@currentlabel\cref@currentlabel% + \global\let\pp@saved@beforefootnote@cref@currentlabel\cref@currentlabel% \pp@backup@@footnotetext{#1}% - \let\cref@currentlabel\pp@saved@beforefootnote@cref@currentlabel% + \global\let\cref@currentlabel\pp@saved@beforefootnote@cref@currentlabel% } \let\pp@backup@H@@footnotetext\H@@footnotetext \renewcommand{\H@@footnotetext}[1]{% @@ -2302,17 +2296,36 @@ \bookmarkdefinestyle{pp@bmstyle@empty}{italic=false,bold=false,color={},rellevel=0,keeplevel=true} \let\pp@backup@@startsection\@startsection \def\@startsection#1#2#3#4#5#6{% - \xdef\BKM@currentlevel{#2}% \bookmarksetup{style=pp@bmstyle@empty}% - \@ifundefined{BKM@style@#2}{}{\bookmarksetup{style=#2}} + \ifx#2\@M% + \xdef\BKM@currentlevel{1}% + \else% + \xdef\BKM@currentlevel{#2}% + \fi% + \@ifundefined{BKM@style@\BKM@currentlevel}{}{\bookmarksetup{style=\BKM@currentlevel}}% \pp@backup@@startsection{#1}{#2}{#3}{#4}{#5}{#6}% } +\let\pp@backup@@sect\@sect +\def\@sect#1#2#3#4#5#6[#7]#8{% + \ifx#2\@M% + \@ifundefined{BKM@style@*}{}{\bookmarksetup{style=*}}% + \fi% + \ifx#2\@m% + \@ifundefined{BKM@style@*}{}{\bookmarksetup{style=*}}% + \fi% + \pp@backup@@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}% + \ifpp@fullbookmarks% + \ifx#7\contentsname% + \Hy@writebookmark{}{#7}{\@currentHref}{\BKM@currentlevel}{toc}% + \fi% + \fi% +} \let\pp@backup@@ssect\@ssect \def\@ssect#1#2#3#4#5{% + \@ifundefined{BKM@style@*}{}{\bookmarksetup{style=*}}% \pp@backup@@ssect{#1}{#2}{#3}{#4}{#5}% \ifpp@fullbookmarks% - \@ifundefined{BKM@style@*}{}{\bookmarksetup{style=*}} \Hy@writebookmark{}{#5}{\@currentHref}{\BKM@currentlevel}{toc}% \fi% } @@ -2367,6 +2380,7 @@ \@ifpackageloaded{cleveref} { + \creflabelformat{equation}{\textup{(}#2\textup{#1}#3\textup{)}} \def\pp@link#1\relax#2\relax#3\relax#4{#1\hyper@@link{}{#4}{#2}#3} \def\pp@rangelink#1\relax#2\relax#3\relax#4\relax#5\relax#6#7{#1\hyper@@link{}{#6}{#2}#3\hyper@@link{}{#7}{#4}#5} \renewcommand{\@@setcref}[2]{% @@ -2432,6 +2446,37 @@ }% }{} +\@ifpackageloaded{biblatex} + { + \appto\blx@mkhyperref{% + \ifundef\hyper@natanchorstart + {% + \long\def\blx@bibhyperref[#1]#2{% + \blx@sfsave% + \hyper@@link[cite]{}{cite.\the\c@refsection @#1}{\blx@sfrest#2\blx@sfsave}% + \blx@sfrest}% + \protected\long\def\blx@imc@bibhyperlink#1#2{% + \blx@sfsave% + \hyper@@link[cite]{}{cite.\the\c@refsection:#1}{\blx@sfrest#2\blx@sfsave}% + \blx@sfrest}% + }% + {% + \long\def\blx@bibhyperref[#1]#2{% + \blx@sfsave% + \Hy@backout{\the\c@refsection @#1}% + \def\hyper@nat@current{#1}% + \hyper@@link[cite]{}{cite.\the\c@refsection @#1}{\blx@sfrest#2\blx@sfsave}% + \blx@sfrest}% + \protected\long\def\blx@imc@bibhyperlink#1#2{% + \blx@sfsave% + \Hy@backout{\the\c@refsection:#1}% + \def\hyper@nat@current{#1}% + \hyper@@link[cite]{}{cite.\the\c@refsection:#1}{\blx@sfrest#2\blx@sfsave}% + \blx@sfrest}% + }% + } + }{} + \newlength{\pp@backup@baselineskip} \newcommand{\pp@odest}[2]{% arguments: {name}{offset} \setlength{\pp@backup@baselineskip}{\the\baselineskip}% @@ -2952,6 +2997,11 @@ \let\pp@BoD\@empty \AtBeginDocument{\gdef\pp@BoD{true}} +\BeforeClearDocument{% + \setcounter{pp@PL@pagenum}{\Hy@abspage}% + \addtocounter{pp@PL@pagenum}{1}% + \protected@write\@auxout{}{\string\gdef\string\pp@totpages{\thepp@PL@pagenum}}% +} \newcommand{\pp@pagelabel}[2][]{% {pagenum}{pagelabel} \ifx\pp@BoD\@empty% \AtBeginDocument{\pp@pagelabel[#1]{#2}}% @@ -2963,10 +3013,10 @@ \ifnum1>\pp@string% \PackageWarning{hypdvips}{Pagelabel `#2' for illegal page `#1' discarded.\MessageBreak}% \else% - \ifnum\ztotpages=0% + \ifnum\pp@totpages=0% \pp@documentPL{\pp@string}{#2}% \else% - \ifnum\ztotpages<\pp@string% + \ifnum\pp@totpages<\pp@string% \pp@attachmentPL{#1}{#2}% \else% \pp@documentPL{\pp@string}{#2}% @@ -3068,12 +3118,12 @@ \fi% } +\newif\ifpp@pagebackref +\pp@pagebackreffalse \@ifundefined{backrefxxx} { } { - \newif\ifpp@pagebackref - \pp@pagebackreffalse \ifx\backrefxxx\page@backref \pp@pagebackreftrue \fi @@ -3152,7 +3202,7 @@ \setcounter{pp@subcaptioncounter}{1}% \@for \sf@temp:=\@subfigcaptionlist \do {% \ifx \@empty\sf@temp\relax \else - \edef\@currentHref{sub#1.\csname theH#1\endcsname.\arabic{pp@subcaptioncounter}}% + \edef\@currentHref{sub#1.\arabic{figure}.\arabic{pp@subcaptioncounter}}% \stepcounter{pp@subcaptioncounter}% \addcontentsline {\@nameuse{ext@sub#1}}% @@ -3413,7 +3463,7 @@ #1% \else% \ifpp@javascript% - \def\Hy@pstringDest{<JavaScript\noexpand™ code>}% + \def\Hy@pstringDest{<JavaScript\noexpand™ language code>}% \pdfmark[#1]{% pdfmark=/ANN,% linktype=#2,% @@ -3441,9 +3491,9 @@ \else% \ifx\pp@string\pp@fa% \PackageWarning{hypdvips}{Attachment (ID = #1) is a FileAttachment-annotation,\MessageBreak - which cannot be launched via JavaScript\noexpand™ code. Use\MessageBreak - the \string\embedfile\space command to create an embedded file\MessageBreak - instead.\MessageBreak}% + which cannot be launched via JavaScript\noexpand™ language\MessageBreak + code. Use the \string\embedfile\space command to create an\MessageBreak + embedded file instead.\MessageBreak}% \else% \PackageWarning{hypdvips}{Attachment (ID = \thepp@id) unknown.\MessageBreak}% \nfss@text{\reset@font\bfseries ??} |