summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-05 23:58:37 +0000
committerKarl Berry <karl@freefriends.org>2011-12-05 23:58:37 +0000
commit4863930a95d1335988d5114d94d30984305aa49c (patch)
treedc8a390429f6c019fc7b8ad5275a2d27a7db7cdf /Master/texmf-dist/tex/latex
parentb498571214c4c006b799b67615b4dbcdb1d310f1 (diff)
pinlabel (5dec11)
git-svn-id: svn://tug.org/texlive/trunk@24769 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/pinlabel/pinlabel.sty54
1 files changed, 42 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/pinlabel/pinlabel.sty b/Master/texmf-dist/tex/latex/pinlabel/pinlabel.sty
index 6fe69d059d9..cb0f798b1af 100644
--- a/Master/texmf-dist/tex/latex/pinlabel/pinlabel.sty
+++ b/Master/texmf-dist/tex/latex/pinlabel/pinlabel.sty
@@ -1,11 +1,11 @@
-%%%% pinlabel.sty Version 1.1
+%%%% pinlabel.sty v1.2
%%%%
%%%% Written by Colin Rourke
%%%%
%%%% Based on geompsfi.sty by Silvio Levy
%%%% Based on psfig.sty by Trevor Darrell
%%%%
-%%%% Copyright 2006 Mathematical Sciences Publishers (MSP)
+%%%% Copyright 2006-11 Mathematical Sciences Publishers (MSP)
%%%%
%%%% NOTICE
%%%%
@@ -31,8 +31,9 @@
%%%% labels in eps or pdf files for inclusion in documents.
%%%% It uses the coordinates provided by ghostview (or gv) to
%%%% position the label and reads the relevant bounding box
-%%%% information from the eps file (which must be provided: if
-%%%% your figure exists only as a pdf file, then run pdf2eps).
+%%%% information from the eps file (or alternatively ps or pdf
+%%%% file). You must supply one of these three. To label a jpg
+%%%% for example, you need to convert it first to eps or pdf.
%%%% Several features are provided which facilitate perfect
%%%% first-time label positioning, of which the most important
%%%% is auto-spacing, which sets the label a predetermined gap
@@ -201,7 +202,9 @@
%%%% but NOT with pdftex. For pdf output from plain TeX use dvips
%%%% followed by ps2pdf.
%%%%
-%%%%
+%%%% NEW FOR VERSION 1.2: Thanks to Mark Petelier, you no longer
+%%%% need to convert a pdf figure to eps. pinlabel now reads the
+%%%% BB from a pdf file if no ps or eps file is supplied.
\edef\atcatcode{\the\catcode`\@} \catcode`@=11
\def\@message#1{\immediate\write16{#1}}
@@ -546,6 +549,7 @@
}
\newif\ifno@file
+\newif\ifno@psfile
\newif\ifno@bb
\newif\ifnot@eof
\newif\if@bbmatch
@@ -565,10 +569,34 @@
\relax\closein\ps@stream
\openin\ps@stream=\@filestem.eps
\ifeof\ps@stream
- \relax %needed here so the \@warning won't cause trouble
- \@warning{cannot open \@filestem.ps or .eps}
- \no@filetrue
- \else
+ \relax\closein\ps@stream\no@psfiletrue
+ \openin\ps@stream=\@filestem.pdf
+ \ifeof\ps@stream
+ \relax %needed here so the \@warning won't cause trouble
+ \@warning{cannot open \@filestem.ps or .eps or .pdf}
+ \closein\ps@stream
+ \no@filetrue
+ \else
+ \edef\@p@sfile{\@filestem.pdf}
+ \relax\closein\ps@stream
+ \ifno@bb
+%
+% Next five lines of code supplied by Mark Petelier
+%
+% Read BB from pdf file:
+%
+ \pdfximage cropbox {\@filestem.pdf}
+ \@p@@sbbllx{\pdfximagebbox\pdflastximage 1}
+ \@p@@sbblly{\pdfximagebbox\pdflastximage 2}
+ \@p@@sbburx{\pdfximagebbox\pdflastximage 3}
+ \@p@@sbbury{\pdfximagebbox\pdflastximage 4}
+ \no@bbfalse
+ \if@bbllx \else \no@bbtrue \fi
+ \if@bblly \else \no@bbtrue \fi
+ \if@bburx \else \no@bbtrue \fi
+ \if@bbury \else \no@bbtrue \fi
+ \fi\fi
+ \else
\relax
\edef\@p@sfile{\@filestem.eps}
\fi
@@ -576,7 +604,7 @@
\relax
\edef\@p@sfile{\@filestem.ps}
\fi
- \ifno@file\else
+ \ifno@psfile\else
\not@eoftrue
\ifno@bb \@bbmatchfalse \else \@bbmatchtrue \fi
\catcode`\%=12
@@ -773,7 +801,7 @@
\parse@ps@parms{#1}%
% Compute any missing sizes.
\compute@bb
- \ifno@file\vbox{\hbox{\footnotesize{\tt\@filestem.\{ps,eps\}}
+ \ifno@file\vbox{\hbox{\footnotesize{\tt\@filestem.\{ps,eps,pdf\}}
not found (or no BBox)}}%
\else
\compute@handw
@@ -1064,4 +1092,6 @@
%%%%% 5/Apr/06: bugfix and extra utility: <Xpt,Ypt> can come first
%%%%% 20/Apr/06: \includegraphics uses graphicx if no labellist (Naom)
%%%%% 1/May/06: bugfix to \includegraphics code
-%%%%% 23/Oct/06: LPPL license added (for CTAN) \ No newline at end of file
+%%%%% 23/Oct/06: LPPL license added (for CTAN)
+%%%%% 4/Nov/11: Version 1.2: Mark Petelier's code added to read BB from pdf file
+