diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-18 22:30:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-18 22:30:38 +0000 |
commit | c3ed4e03e9ea716aafea65c70f9db17984fcf3a9 (patch) | |
tree | fded714a15211a4b635510b5ca9f2205f4edbff5 /Master/texmf-dist/tex/latex/currfile | |
parent | 37b598addb36d4147027a2296f0fc112c5dd84ba (diff) |
currfile 0.5 (18sep11)
git-svn-id: svn://tug.org/texlive/trunk@24006 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/currfile')
-rw-r--r-- | Master/texmf-dist/tex/latex/currfile/currfile.sty | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/currfile/currfile.sty b/Master/texmf-dist/tex/latex/currfile/currfile.sty index e686b93fe32..dd7dd5937f2 100644 --- a/Master/texmf-dist/tex/latex/currfile/currfile.sty +++ b/Master/texmf-dist/tex/latex/currfile/currfile.sty @@ -16,12 +16,11 @@ %% The Current Maintainer of this work is Martin Scharrer. %% %% This work consists of the files currfile.dtx, currfile.ins -%% and the derived file currfile.sty. +%% and currfile.sty. %% -%% $Id: currfile.dtx 2036 2011-01-09 17:51:42Z martin $ +%% $Id$ \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{currfile} - [2011/01/09 v0.4 Current input file name and path] +\ProvidesPackage{currfile}[2011/01/09 v0.4 Current input file name and path] \RequirePackage{kvoptions} \SetupKeyvalOptions{family=currfile,prefix=currfile@} @@ -59,16 +58,55 @@ } \def\currfile@set#1{% \begingroup - \edef\@tempa{#1}% - \@onelevel@sanitize\@tempa - \expandafter\filename@parse\expandafter{\@tempa}% + \edef\@filef@und{#1}% + \ifx\input@path\@undefined\else + \currfile@checkpath + \fi + \@onelevel@sanitize\@filef@und + \let\filename@simple\currfile@parseext + \let\filename@base\@gobble + \expandafter\filename@parse\expandafter{\@filef@und}% \global\let\currfiledir\filename@area \global\let\currfilebase\filename@base - \xdef\currfileext{\ifx\filename@ext\relax tex\else\filename@ext\fi}% - \xdef\currfilename{\currfilebase\ifx\currfileext\empty\else.\currfileext\fi}% + \global\let\currfileext\filename@ext + \xdef\currfilename{\currfilebase\ifx\currfileext\@empty\else.\currfileext\fi}% \xdef\currfilepath{\currfiledir\currfilename}% \endgroup } +\def\currfile@checkpath{% + \openin\@inputcheck\@filef@und\relax + \ifeof\@inputcheck + \expandafter\@tfor + \expandafter\@tempb + \expandafter:\expandafter=\input@path\do{% + \openin\@inputcheck\@tempb\@filef@und\relax + \ifeof\@inputcheck\else + \edef\@filef@und{\@tempb\@filef@und}% + \@break@tfor + \fi + }% + \fi + \closein\@inputcheck +} +\begingroup +\@makeother{.} +\gdef\currfile@parseext#1.#2\\{% + \ifx\\#2\\% + \ifx\filename@base\@gobble + \def\filename@base{#1}% + \let\filename@ext\currfile@defaultext% + \else + \def\filename@ext{#1}% + \fi + \else + \edef\filename@base{\filename@base.#1}% + \def\@tempa{\currfile@parseext#2\\}% + \expandafter\@tempa + \fi +} +\endgroup +\def\currfile@defaultext{tex} +\@onelevel@sanitize\currfile@defaultext \def\currfile@push{% \xdef\currfile@stack{% {\currfiledir}% |