2 %% This is file `figlatex.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% figlatex.dtx (with options: `package')
11 %% For the copyright see the source file.
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from figlatex.sty.
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file figlatex.dtx.
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
24 %% File: figlatex.dtx Copyright (C) 2002--2005 V. Danjean, A. Legrand
25 %% Vincent.Danjean@ens-lyon.org
26 %% Arnaud.Legrand@ens-lyon.org
28 %% This program is free software; you can redistribute it and/or
29 %% modify it under the terms of the GNU General Public License
30 %% as published by the Free Software Foundation; either version 2
31 %% of the License, or (at your option) any later version.
33 %% This program is distributed in the hope that it will be useful,
34 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
35 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 %% GNU General Public License for more details.
38 %% You should have received a copy of the GNU General Public License
39 %% along with this program; if not, write to the Free Software
40 %% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
42 \NeedsTeXFormat{LaTeX2e}%
43 \ProvidesPackage{figlatex}%
44 [2005/03/28 v0.1.2 include fig in LaTeX]
45 \newif\ifFL@compatibility
46 \DeclareOption{compatibility}{%
47 %\PackageWarning{figlatex}{option compatibility}%
48 \global\FL@compatibilitytrue%
51 \DeclareOption{debug}{%
56 \ExecuteOptions{compatibility}%
59 \ExecuteOptions{debug}%
61 \InputIfFileExists{figlatex.cfg}{%
62 \typeout{***************************************^^J%
63 * Local config file figlatex.cfg used *^^J%
64 ***************************************}
66 \typeout{Found no configuration file for figlatex}
70 \RequirePackage{ifpdf}
71 \RequirePackage{graphicx}
72 \RequirePackage{color}
73 \RequirePackage{epstopdf}
79 \def\Ginclude@rawtex#1{%
83 \ifx\Gin@scaley\@tempa%
84 \let\Gin@scaley\Gin@scalex%
86 \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi%
89 \Gscale@box{\Gin@scalex}[\Gin@scaley]{%
91 \let\Gin@scaley\Gin@exclamation% needed for pdflatex
92 \FL@dmessage{<loading rawtex #1>}%
95 \def\Ginclude@figtex#1{%
98 \xdef\FL@filename{#1}%
99 \filename@parse{\FL@filename}%
100 \xdef\FL@filename{\filename@area\filename@base.\FL@figext}%
101 \FL@dmessage{<****loading fig \FL@filename>}%
102 \FL@includerawtexgraphics[]{\FL@filename}%
104 \newcommand{\Gread@figtex}[1]{%
105 %\typeout{Oh, file exists #1}%
109 \def\FL@figext{pdftex_t}%
110 \let\Gread@rawtex\Gread@pdf%
111 \DeclareGraphicsRule{.pdftex}{pdf}{*}{}%
113 \PackageWarningNoLine{figlatex}{Compatibility mode enabled
115 \MessageBreak Using .pdf extension for pdftex files}%
116 \DeclareGraphicsRule{.pdftex_t}{rawtex}{.pdf}{}%
117 \DeclareGraphicsRule{.fig}{figtex}{.pdf}{}%
119 \DeclareGraphicsRule{.pdftex_t}{rawtex}{.pdftex}{}%
120 \DeclareGraphicsRule{.fig}{figtex}{.pdftex}{}%
123 \def\FL@figext{pstex_t}%
124 \let\Gread@rawtex\Gread@eps%
125 \DeclareGraphicsRule{.pstex}{eps}{*}{}%
126 \DeclareGraphicsRule{.pstex_t}{rawtex}{.pstex}{}%
127 \DeclareGraphicsRule{.fig}{figtex}{.pstex}{}%
129 \newcommand{\FL@includerawtexgraphics}[2][]{%
130 \includegraphics[#1]{#2}%
132 \def\FL@exclamation{!}%
133 \let\FL@subfig@name\FL@exclamation%
134 \define@key{Gin}{subfig}{%
135 \def\FL@subfig@name{#1}%
137 \def\FL@sepdefault{_}%
138 \def\FL@Gin@getbase#1{%
139 \ifx\FL@subfig@name\FL@exclamation%
141 \ifthenelse{\equal{#1}{.fig}}{%
142 % If we're including a subfig
143 \IfFileExists{\filename@area\filename@base#1}{%
144 % If the original .fig file exists, just change the name so that
145 % it comprises the full path.
146 \filename@parse{\@filef@und}%
147 % Remove potential trailing spage at the end of the extension
148 \def\filename@ext{fig}%
150 % Else, write a warning (LaTeX will warn as well but it doesn't
152 \PackageWarning{figlatex}{No file
153 '\filename@area\filename@base#1'}%
155 % Add the subfig suffix to the fig name.
156 \edef\filename@base{\filename@base\FL@sepdefault\FL@subfig@name}%
160 \FL@orig@Gin@getbase{#1}%
162 \let\FL@orig@Gin@getbase\Gin@getbase
163 \let\Gin@getbase\FL@Gin@getbase
168 %% End of file `figlatex.sty'.