summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-08 00:02:42 +0000
committerKarl Berry <karl@freefriends.org>2008-09-08 00:02:42 +0000
commit11debc9eaa698bd999e63943e09eff84d52dcd28 (patch)
tree84edd62b72146b3fea745af0649f56c1a7ce4605 /Master/texmf-dist/tex
parentd09e3f969cdaae4aacbf213286c01ff9962009ef (diff)
hypdvips update (3sep08)
git-svn-id: svn://tug.org/texlive/trunk@10459 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty160
1 files changed, 128 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty b/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty
index bcb280a139d..7c813b547f0 100644
--- a/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty
+++ b/Master/texmf-dist/tex/latex/hypdvips/hypdvips.sty
@@ -20,12 +20,59 @@
%% ------------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{hypdvips}[2008/08/12 v1.00 - Hyperref extension for dvips]
-\RequirePackage{xkeyval}
-\RequirePackage[totpages]{zref}
+\ProvidesPackage{hypdvips}
+ [2008/09/02 v1.02
+ Hyperref extensions for use with dvips]
\RequirePackage{hyperref}
+\newif\ifpp@dvips
+\def\pp@string{hdvips}
+\ifx\Hy@driver\pp@string
+ \pp@dvipstrue
+\else
+ \PackageError{hypdvips}{Unable to find dvips}\@ehd
+ \pp@dvipsfalse
+\fi
\RequirePackage{hypcap}
-\RequirePackage{bookmark}
+\RequirePackage{xkeyval}
+\@ifpackageloaded{bookmark}
+ {
+ \PackageWarning{hypdvips}{Package `bookmark' should not be loaded before\MessageBreak hypdvips.\MessageBreak}%
+ }
+ {
+ \define@key[pp]{bookmarkfix}{header}{\def\pp@headerfile{#1}}
+ \let\pp@backup@special\special
+ \renewcommand{\special}[1]{%
+ \let\pp@headerfile\@undefined%
+ \setkeys*[pp]{bookmarkfix}{#1}%
+ \@ifundefined{pp@headerfile}{\pp@backup@special{#1}}{\pp@backup@special{header=./\pp@headerfile}}%
+ }
+ \RequirePackage{bookmark}
+ \let\special\pp@backup@special
+ }
+\define@key{BKM}{italic}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM@style}{0}%
+ \else
+ \bitsetClear{BKM@style}{0}%
+ \fi
+ }
+\define@key{BKM}{bold}[true]{%
+ \expandafter\ifx\csname if#1\endcsname\iftrue
+ \bitsetSet{BKM@style}{1}%
+ \else
+ \bitsetClear{BKM@style}{1}%
+ \fi
+ }
+\define@key{BKM}{italic,bold}[]{%
+ \bitsetSet{BKM@style}{0}%
+ \bitsetSet{BKM@style}{1}%
+ }
+\define@key{BKM}{bold,italic}[]{%
+ \bitsetSet{BKM@style}{0}%
+ \bitsetSet{BKM@style}{1}%
+ }
+\RequirePackage[totpages]{zref}
+\RequirePackage{xcolor}
\hypersetup{breaklinks=true}
\ifHy@unicode
\else
@@ -37,11 +84,10 @@
\newlength{\pp@linewidth}
\newcommand{\pp@drawcurrentpoint}[1]{%
\setlength{\pp@linewidth}{#1}%
- \pp@SDictPS{\strip@pt\pp@linewidth\space pp.BPToPDF pp.drawcurrentpoint}%
+ \pp@SDictPS{1 0 0 \strip@pt\pp@linewidth\space pp.BPToPDF pp.drawcurrentpoint}%
}
\providecommand{\point}{\pp@drawcurrentpoint{1mm}}
\providecommand{\currentpoint}[1]{\pp@drawcurrentpoint{#1}}% arguments: {linewidth}
-\providecommand{\psdebug}[1]{\pp@SDictPS{(#1) pstack pop}}% arguments: {string}
\providecommand{\debug}[1]{\PackageWarning{DEBUG}{#1}}% arguments: {string}
%%
%% End of debug commands.
@@ -251,7 +297,7 @@
}
\newcommand{\pp@languageoption}[1]{
- \define@key[pp]{options}{#1}[]{\csname pp@language@#1\endcsname\typeout{language = #1}}
+ \define@key[pp]{options}{#1}[]{\ifpp@languageset\else\csname pp@language@#1\endcsname\typeout{language = #1}\fi}
}
\newcommand{\pp@SpecialPS}[1]{\special{" #1}}
@@ -764,12 +810,12 @@
show
grestore
} def
- /pp.drawcurrentpoint % arguments: linewidth
+ /pp.drawcurrentpoint % arguments: R, G, B, linewidth
{
gsave
initmatrix
setlinewidth
- 1 0 0 setrgbcolor
+ setrgbcolor
-5 -5 rmoveto
10 10 rlineto
-10 0 rmoveto
@@ -836,6 +882,44 @@
repeat
exch pop
} def
+ /pp.enabletracing
+ {
+ SDict /pp.leftboundary undef
+ SDict /pp.rightboundary undef
+ /a where
+ {
+ /a
+ {
+ currentpoint pop
+ SDict /pp.rightboundary known dup
+ {
+ SDict /pp.rightboundary get 2 index lt {not} if
+ }
+ if
+ {pop}
+ {SDict exch /pp.rightboundary exch put}
+ ifelse
+ moveto
+ currentpoint pop
+ SDict /pp.leftboundary known dup
+ {
+ SDict /pp.leftboundary get 2 index gt {not} if
+ }
+ if
+ {pop}
+ {SDict exch /pp.leftboundary exch put}
+ ifelse
+ }
+ put
+ }
+ if
+ } def
+ /pp.disabletracing
+ {
+ /a where {/a {moveto} put} if
+ SDict /pp.leftboundary known {pp.outerbox 0 pp.leftboundary put} if
+ SDict /pp.rightboundary known {pp.outerbox 2 pp.rightboundary put} if
+ } def
/pp.addtoquadpoints
{
currentdict /pp.qp known
@@ -1771,7 +1855,7 @@
\newif\ifpp@activerect
\pp@activerectfalse
-\renewcommand{\pdf@rect}[1]{%
+\def\pdf@rect#1{%
\pp@activerecttrue%
\leavevmode%
\ifHy@breaklinks%
@@ -1808,12 +1892,14 @@
\else%
\lower\dp\pdf@box\hbox{\literalps@out{H.S}}%
\fi%
+ \pp@SDictPS{pp.enabletracing}%
\ifHy@breaklinks%
\expandafter\Hy@breaklinksunhbox%
\else%
\expandafter\box%
\fi%
\pdf@box%
+ \pp@SDictPS{pp.disabletracing}%
\ifpp@evenboxes%
\setlength{\pp@offset}{\the\dimen@}%
\addtolength{\pp@offset}{-\the\ht\pp@textbox}%
@@ -2602,13 +2688,17 @@
\ifx\pp@string\@empty%
\edef\pp@string{\value{pp@PL@currentpage}}%
\fi%
- \ifnum0=\pp@string%
+ \ifnum1>\pp@string%
\PackageWarning{hypdvips}{Pagelabel `#2' for illegal page `#1' discarded.\MessageBreak}%
\else%
- \ifnum\ztotpages<\pp@string%
- \pp@attachmentPL{#1}{#2}%
- \else%
+ \ifnum\ztotpages=0%
\pp@documentPL{\pp@string}{#2}%
+ \else%
+ \ifnum\ztotpages<\pp@string%
+ \pp@attachmentPL{#1}{#2}%
+ \else%
+ \pp@documentPL{\pp@string}{#2}%
+ \fi%
\fi%
\fi%
\fi%
@@ -3228,24 +3318,30 @@
%%
%% Exported commands:
%%
-\providecommand{\attachfile}[2][]{\pp@attachfile[#1]{#2}}% arguments: [options]{filename}
-\providecommand{\backrefbordercolor}[1]{\gdef\@backrefbordercolor{#1}}% arguments: {R G B}
-\providecommand{\backrefcolor}[1]{\gdef\@backrefcolor{#1}}% arguments: {color}
-\providecommand{\bmstyle}[2]{\pp@setbmstyle{#1}{#2}}% arguments: {level}{style}
-\providecommand{\embeddedbordercolor}[1]{\gdef\@embeddedbordercolor{#1}}% arguments: {R G B}
-\providecommand{\embeddedcolor}[1]{\gdef\@embeddedcolor{#1}}% arguments: {color}
-\providecommand{\embedfile}[2][]{\pp@embedfile[#1]{#2}}% arguments: [options]{filename}
-\providecommand{\evenboxesstring}[1]{\gdef\pp@ABC{#1}}% arguments: {string}
-\providecommand{\file}[2]{\pp@file{#1}{#2}}% arguments: {filename}{description}
-\providecommand{\footnotebordercolor}[1]{\gdef\@footnotebordercolor{#1}}% arguments: {R G B}
-\providecommand{\footnotecolor}[1]{\gdef\@footnotecolor{#1}}% arguments: {color}
-\providecommand{\goto}[2][]{\pp@goto[#1]{#2}}% arguments: [options]{text}
-\providecommand{\gotoparent}[2]{\pp@goto[dest={#1},target=/R/P]{#2}}% arguments: {destination}{text}
-\providecommand{\loaformat}[4]{\pp@loaformat{#1}{#2}{#3}{#4}}% arguments: {attachment_id}{attachment_type}{filename}{options}
-\providecommand{\odest}[2]{\pp@odest{#1}{#2}}% arguments: {name}{offset}
-\providecommand{\openaction}[1]{\def\pp@openaction{#1}}% arguments: {action}
-\providecommand{\pagelabel}[2][]{\pp@pagelabel[#1]{#2}}% {pagenumber}{pagelabel}
-\providecommand{\runattachment}[2]{\pp@runattachment{#1}{#2}}% arguments: {attachment_id}{text}
+\ifpp@dvips
+ \providecommand{\attachfile}[2][]{\pp@attachfile[#1]{#2}}% arguments: [options]{filename}
+ \providecommand{\backrefbordercolor}[1]{\gdef\@backrefbordercolor{#1}}% arguments: {R G B}
+ \providecommand{\backrefcolor}[1]{\gdef\@backrefcolor{#1}}% arguments: {color}
+ \providecommand{\bmstyle}[2]{\pp@setbmstyle{#1}{#2}}% arguments: {level}{style}
+ \providecommand{\embeddedbordercolor}[1]{\gdef\@embeddedbordercolor{#1}}% arguments: {R G B}
+ \providecommand{\embeddedcolor}[1]{\gdef\@embeddedcolor{#1}}% arguments: {color}
+ \providecommand{\embedfile}[2][]{\pp@embedfile[#1]{#2}}% arguments: [options]{filename}
+ \providecommand{\evenboxesstring}[1]{\gdef\pp@ABC{#1}}% arguments: {string}
+ \providecommand{\file}[2]{\pp@file{#1}{#2}}% arguments: {filename}{description}
+ \providecommand{\footnotebordercolor}[1]{\gdef\@footnotebordercolor{#1}}% arguments: {R G B}
+ \providecommand{\footnotecolor}[1]{\gdef\@footnotecolor{#1}}% arguments: {color}
+ \providecommand{\goto}[2][]{\pp@goto[#1]{#2}}% arguments: [options]{text}
+ \providecommand{\gotoparent}[2]{\pp@goto[dest={#1},target=/R/P]{#2}}% arguments: {destination}{text}
+ \providecommand{\loaformat}[4]{\pp@loaformat{#1}{#2}{#3}{#4}}% arguments: {attachment_id}{attachment_type}{filename}{options}
+ \providecommand{\odest}[2]{\pp@odest{#1}{#2}}% arguments: {name}{offset}
+ \providecommand{\openaction}[1]{\def\pp@openaction{#1}}% arguments: {action}
+ \providecommand{\pagelabel}[2][]{\pp@pagelabel[#1]{#2}}% {pagenumber}{pagelabel}
+ \providecommand{\runattachment}[2]{\pp@runattachment{#1}{#2}}% arguments: {attachment_id}{text}
+\else
+ \@ifundefined{pdfmark}{\newcommand{\pdfmark}[2][]{#1}}{}
+ \def\@pdfview{Fit}
+ \let\@pdfviewparams\@empty
+\fi
\@ifpackageloaded{cleveref}
{
\let\autoref\cref