summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:01:29 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:01:29 +0000
commitd003712cd0d9641cd5023bff0b66efb21b27c667 (patch)
treec6ff9d04d838add922dcae3bddf6b80ebed9aec6 /Master/texmf-dist/tex
parentdf178b3d856fa696dbc507ef7273d0aec388e080 (diff)
overpic
git-svn-id: svn://tug.org/texlive/trunk@1162 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/overpic/overpic.sty98
1 files changed, 98 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/overpic/overpic.sty b/Master/texmf-dist/tex/latex/overpic/overpic.sty
new file mode 100644
index 00000000000..f3622fd67d8
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/overpic/overpic.sty
@@ -0,0 +1,98 @@
+
+% overpic.sty
+
+% Copyright 1999 Rolf Niepraschk, niepraschk@ptb.de
+% This program can be redistributed and/or modified under the terms
+% of the LaTeX Project Public License Distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt; either
+% version 1 of the License, or any later version.
+
+% \changes{v0.51}{1999/03/02}{New (LPPL) license}
+% \changes{v0.52}{1999/07/04}{Correction of wrong height calculation
+% (if depth != 0)}
+
+
+\def\fileversion{v0.52}
+\def\filedate{1999/07/04}%
+
+\ProvidesPackage{overpic}
+ [\filedate\space\fileversion\space\space Overwriting eps pictures]
+
+\NeedsTeXFormat{LaTeX2e}
+
+\typeout{Package: overpic \fileversion\space <\filedate> (RN)}
+
+\newcommand\OVP@scale{}
+
+\DeclareOption{percent}{\renewcommand\OVP@scale{100}}
+\DeclareOption{permil}{\renewcommand\OVP@scale{\@m}}
+\DeclareOption{abs}{\renewcommand\OVP@scale{\z@}}
+
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
+
+\ExecuteOptions{percent}
+
+\ProcessOptions
+
+\RequirePackage{graphicx,epic}
+
+\newif\ifGin@grid
+
+\define@key{Gin}{grid}[true]{\lowercase{\Gin@boolkey{#1}}{grid}}
+\define@key{Gin}{tics}{\count@=#1}
+\define@key{Gin}{unit}{\setlength{\@tempdima}{#1}}
+
+\ifnum\OVP@scale>\z@%
+ \ifnum\OVP@scale=\@m%
+ \typeout{overpic: relative positioning in permil}%
+ \else%
+ \typeout{overpic: relative positioning in percent}%
+ \fi%
+ \newcommand\OVP@calc{%
+ \ifnum\@tempcnta>\@tempcntb%
+ \divide\@tempcnta by \OVP@scale%
+ \setlength\unitlength{\@tempcnta sp}%
+ \@tempcnta=\OVP@scale%
+ \divide\@tempcntb by \unitlength%
+ \else%
+ \divide\@tempcntb by \OVP@scale%
+ \setlength\unitlength{\@tempcntb sp}%
+ \@tempcntb=\OVP@scale%
+ \divide\@tempcnta by \unitlength%
+ \fi%
+ \ifnum\count@=\z@%
+ \count@=\OVP@scale\divide\count@ by 10%
+ \fi%
+ }%
+\else%
+ \typeout{overpic: absolute positioning in \unitlength}%
+ \newcommand\OVP@calc{%
+ \setlength{\unitlength}{\@tempdima}%
+ \divide\@tempcnta by \unitlength%
+ \divide\@tempcntb by \unitlength%
+ \ifnum\count@=\z@\count@=10\fi%
+ }%
+\fi%
+
+\newenvironment{overpic}[2][]{%
+ \sbox{\z@}{\includegraphics[#1]{#2}}%
+ \settodepth{\@tempcnta}{\usebox{\z@}}%
+ \settoheight{\@tempcntb}{\usebox{\z@}}%
+ \advance\@tempcntb\@tempcnta%
+ \settowidth{\@tempcnta}{\usebox{\z@}}%
+ \setlength{\@tempdima}{\unitlength}%
+ \count@=\z@\Gin@gridfalse\setkeys{Gin}{#1}%
+%
+ \OVP@calc%
+%
+ \begin{picture}(\@tempcnta,\@tempcntb)%
+ \put(0,0){\makebox(0,0)[bl]{\usebox{\z@}}}%
+ \ifGin@grid%
+ \put(0,0){\normalfont\fontsize\@viipt\@viiipt\selectfont%
+ \grid(\@tempcnta,\@tempcntb)(\count@,\count@)[0,0]}%
+ \fi%
+}{%
+ \end{picture}%
+}%
+
+\endinput