summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex-dev/graphics/epsfig.dtx
blob: 8e883bd8df776889361b654be1b226d64ab8bab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
%
% \iffalse
%
%% epsfig.dtx Copyright (C) 1994-1996 1999 Sebastian Rahtz
%%            Copyright (C) 2000-2020 David Carlisle, LaTeX3 Project
%%
%% This file is part of the Standard LaTeX `Graphics Bundle'.
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.3 or, at your option, any later version.
%%
%<*dtx>
          \ProvidesFile{epsfig.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
%<package>\ProvidesPackage{epsfig}
%<driver> \ProvidesFile{epsfig.drv}
% \fi
%         \ProvidesFile{epsfig.dtx}
                  [2017/06/25 v1.7b (e)psfig emulation (SPQR)]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\begin{document}
 \DocInput{epsfig.dtx}
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{epsfig.dtx}
%
% \title{The \textsf{epsfig} package\thanks{This file
%        has version number \fileversion, last
%        revised \filedate.}}
% \author{Sebastian Rahtz\\latex-team@latex-project.org}
% \date{\filedate}
% \MaintainedByLaTeXTeam{graphics}
% \maketitle
%
%
% \StopEventually{}
%
% \section{Preface}
%    \begin{macrocode}
%<*package>
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
\ProcessOptions
\RequirePackage{graphicx}
%    \end{macrocode}
% \subsection{Emulation of `psfig' syntax}
% Emulate "epsfig.sty", and most varieties of psfig
% \begin{macro}{\psfig,\epsfig}
%    \begin{macrocode}
\def\psfig#1{%
 \let\Gin@ewidth\Gin@exclamation\let\Gin@eheight\Gin@ewidth
 \def\Gin@req@sizes{%
   \def\Gin@scalex{1}\let\Gin@scaley\Gin@exclamation
   \Gin@req@height\Gin@nat@height
   \Gin@req@width\Gin@nat@width}%
   \begingroup
    \let\Gfigname\relax
    \@tempswafalse
    \toks@{\Ginclude@graphics{\Gfigname}}%
    \setkeys{Gin}{#1}%
    \Gin@esetsize
    \ifx\Gfigname\relax\ErrorNoFile\else
      \the\toks@
    \fi
  \endgroup}
\define@key{Gin}{figure}{\def\Gfigname{#1}}
\define@key{Gin}{file}{\def\Gfigname{#1}}
\define@key{Gin}{prolog}{\typeout{epsfig: header files are not needed}}
\define@key{Gin}{silent}[]{}
\def\psdraft{\Gin@drafttrue}
\def\psfull{\Gin@draftfalse}
\def\pssilent{\typeout{epsfig option `silent' ignored}}
\def\psnoisy{\typeout{epsfig option `noisy' ignored}}
\let\epsfig\psfig
\def\psfigdriver#1{\makeatletter\input{#1.def}\makeatother}
%    \end{macrocode}
% \end{macro}
% \subsection{Emulation of `epsf' syntax}
% Emulate Rokicki's "epsf.tex" supplied with the ever-popular dvips.
% \begin{macro}{\epsfbox,\epsffile}
%    \begin{macrocode}
\newdimen\epsfxsize
\newdimen\epsfysize
\epsfysize\z@
\epsfxsize\z@
\def\epsfsize#1#2{\epsfxsize}
\def\epsfbox{%
 \@ifnextchar[%
  {\Gin@bboxtrue\epsf@bb@box}%
  {\Gin@bboxfalse\epsf@box}%
}
\def\epsf@bb@box[#1#2]{%
  \expandafter\Gread@parse@bb#1#2 \\
  \epsf@box}
\def\epsf@box#1{%
 \bgroup
   \def\Gin@req@sizes{%
        \epsfxsize\epsfsize{\Gin@nat@width}{\Gin@nat@height}%
        \ifdim\epsfxsize=\z@
            \ifdim\epsfysize=\z@
                \Gin@req@height\Gin@nat@height
                \Gin@req@width\Gin@nat@width
            \else
                \let\Gin@scalex\Gin@exclamation
                \Gin@req@height\epsfysize
                \Gscale@div\Gin@scaley\Gin@req@height\Gin@nat@height
                \Gin@req@width\Gin@scaley\Gin@nat@width
            \fi
        \else
            \Gin@req@width\epsfxsize
            \Gscale@div\Gin@scalex\Gin@req@width\Gin@nat@width
            \ifdim\epsfysize=\z@
                \let\Gin@scaley\Gin@exclamation
                \Gin@req@height\Gin@scalex\Gin@nat@height
            \else
                \Gin@req@height\epsfysize
                \Gscale@div\Gin@scaley\Gin@req@height\Gin@nat@height
            \fi
        \fi
      }%
 \Ginclude@graphics{#1}%
 \egroup
 \epsfysize\z@
 \epsfxsize\z@
}
\let\epsffile\epsfbox
\def\epsfclipon{\Gin@cliptrue}
\def\epsfclipoff{\Gin@clipfalse}
\def\epsfverbosetrue{\typeout{epsf verbose option ignored}}
\def\epsfverbosefalse{\typeout{epsf verbose option ignored}}
%</package>
%    \end{macrocode}
% \end{macro}
%
% \Finale
%