diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/grffile.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/grffile.sty | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/grffile.sty b/Master/texmf-dist/tex/latex/oberdiek/grffile.sty index 8e600b4ec79..6794480ce2a 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/grffile.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/grffile.sty @@ -28,7 +28,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{grffile}% - [2007/04/11 v1.3 Extended file name support for graphics (HO)]% + [2007/06/13 v1.4 Extended file name support for graphics (HO)]% \edef\grffile@RestoreCatcodes{% \catcode`\noexpand\=\the\catcode`\=\relax \catcode`\noexpand\:\the\catcode`\:\relax @@ -59,6 +59,11 @@ \DeclareBoolOption[true]{babel} \DeclareBoolOption[false]{extendedchars} \DeclareBoolOption{space} +\DeclareVoidOption{encoding}{% + \RequirePackage{stringenc}\relax +} +\DeclareStringOption{inputencoding} +\DeclareStringOption{filenameencoding} \DeclareDefaultOption{% \PassOptionsToPackage\CurrentOption{graphics}% } @@ -80,12 +85,32 @@ \fi \fi \ProcessKeyvalOptions* +\AtBeginDocument{% + \DisableKeyvalOption[package=grffile]{Gin}{encoding}% +} \RequirePackage{graphics} \newcommand*{\grffilesetup}{% \setkeys{Gin}% } \let\grffile@org@Ginclude@graphics\Ginclude@graphics \renewcommand*{\Ginclude@graphics}{% + \ifx\grffile@fileencoding\@empty + \else + \ifx\grffile@inputencoding\@empty + \expandafter\ifx\csname inputencodingname\endcsname\relax + \expandafter\ifx\csname CurrentInputEncodingOption\endcsname\relax + \else + \let\grffile@inputencoding\CurrentInputEncodingOption + \fi + \else + \let\grffile@inputencoding\inputencodingname + \fi + \fi + \ifx\grffile@inputencoding\@empty + \else + \grffile@extendedcharstrue + \fi + \fi \ifnum0\ifgrffile@babel 1\fi\ifgrffile@extendedchars 1\fi>\z@ \begingroup \ifgrffile@babel @@ -104,8 +129,34 @@ \fi } \def\grffile@extchar@Ginclude@graphics#1{% + \def\grffile@filename{#1}% + \ifx\grffile@inputencoding\@empty + \else + \ifx\grfile@filenameencoding\@empty + \else + \ifx\grffile@inputencoding\grffile@filenameencoding + \else + \expandafter\ifx\csname StringEncodingConvert\endcsname\relax + \PackageError{grffile}{% + Package `stringenc' is not loaded,\MessageBreak + omitting file name conversion% + }\@ehc + \else + \StringEncodingConvert\grffile@temp\grffile@filename + \grffile@inputencoding\grffile@filenameencoding + \StringEncodingSuccessFailure{% + \let\grffile@filename\grffile@temp + }{% + \PackageError{grffile}{% + Filename conversion failed% + }\@ehc + }% + \fi + \fi + \fi + \fi \edef\x{\endgroup - \noexpand\grffile@Ginclude@graphics{#1}% + \noexpand\grffile@Ginclude@graphics{\grffile@filename}% }% \x } |