diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/grffile.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/grffile.sty | 72 |
1 files changed, 56 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/grffile.sty b/Master/texmf-dist/tex/latex/oberdiek/grffile.sty index 829dbbcd6da..5d5216c5075 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/grffile.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/grffile.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2006-2008 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% Copyright (C) 2006-2009 by Heiko Oberdiek <oberdiek@uni-freiburg.de> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -29,7 +29,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{grffile}% - [2008/10/13 v1.9 Extended file name support for graphics (HO)]% + [2009/09/25 v1.10 Extended file name support for graphics (HO)]% \edef\grffile@RestoreCatcodes{% \catcode`\noexpand\=\the\catcode`\=\relax \catcode`\noexpand\:\the\catcode`\:\relax @@ -229,26 +229,66 @@ \def\grffile@filename@simple#1.#2\\{% \ifx\\#2\\% - \ifx\filename@base\@empty - \let\filename@ext\relax + \def\filename@base{#1}% + \let\filename@ext\relax + \else + \def\filename@base{}% + \grffile@analyze@ext{#1}.{#2}\\% + \fi +} + +\def\grffile@analyze@ext#1.#2\\{% + \let\grffile@next\relax + \ifx\\#2\\% + \edef\filename@base{\filename@base#1}% + \let\filename@ext\relax + \def\grffile@next{\grffile@try@extlist}% + \else + \edef\filename@base{\filename@base #1}% + \edef\filename@ext{\filename@dot#2\\}% + \expandafter\ifx\csname Gin@rule@.\filename@ext\endcsname\relax + \edef\filename@base{\filename@base.}% + \def\grffile@next{\grffile@analyze@ext#2\\}% \else - \grffile@ReturnAfterFiFiBase{% - \edef\filename@base{\expandafter\filename@dot\filename@base\\}% - \edef\filename@ext{#1}% + \grffile@IfFileExists{\filename@area\filename@base.\filename@ext}{% + % success + }{% + \edef\filename@base{\filename@base.\filename@ext}% + \let\filename@ext\relax + \def\grffile@next{\grffile@try@extlist}% }% \fi + \fi + \grffile@next +} + +\def\grffile@try@extlist{% + \@for\grffile@temp:=\Gin@extensions\do{% + \grffile@IfFileExists{\filename@area\filename@base\grffile@temp}{% + \ifx\filename@ext\relax + \edef\filename@ext{\expandafter\@gobble\grffile@temp\@empty}% + \fi + }{}% + }% + \ifx\filename@ext\relax + \expandafter\let\expandafter\filename@base\expandafter\@empty + \expandafter\grffile@use@last@ext\filename@base.\\% + \fi +} + +\def\grffile@use@last@ext#1.#2\\{% + \ifx\\#2\\% + \edef\filename@base{\expandafter\filename@dot\filename@base\\}% + \def\filename@ext{#1}% + \expandafter\@gobble \else - \expandafter\ifx\csname - Gin@rule@.\filename@dot #2\\\endcsname\relax - \edef\filename@base{\filename@base #1.}% - \grffile@ReturnAfterFiFiBase{\grffile@filename@simple #2\\}% - \else - \edef\filename@ext{\filename@dot #2\\}% - \fi + \edef\filename@base{\filename@base#1.}% + \expandafter\@firstofone \fi - \edef\filename@base{\filename@base #1}% + {% + \grffile@use@last@ext#2\\% + }% } -\def\grffile@ReturnAfterFiFiBase#1#2\fi\edef\filename@base#3{\fi\fi#1} \def\grffile@option@status#1{% \begingroup \let\on@line\@empty |