summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/currfile
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-01-11 00:37:24 +0000
committerKarl Berry <karl@freefriends.org>2011-01-11 00:37:24 +0000
commit16d9f4855f8b6ffc886506f977596c5aa7b2ef12 (patch)
tree35da758be49ae6aea80c583ea4b4d32bdb06de04 /Master/texmf-dist/tex/latex/currfile
parenta18f121416672b65166583b9b12157ae1711ae07 (diff)
currfile 0.4 (10jan11)
git-svn-id: svn://tug.org/texlive/trunk@21012 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/currfile')
-rw-r--r--Master/texmf-dist/tex/latex/currfile/currfile.sty34
1 files changed, 29 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/currfile/currfile.sty b/Master/texmf-dist/tex/latex/currfile/currfile.sty
index cc76c8bf2c3..e686b93fe32 100644
--- a/Master/texmf-dist/tex/latex/currfile/currfile.sty
+++ b/Master/texmf-dist/tex/latex/currfile/currfile.sty
@@ -18,10 +18,10 @@
%% This work consists of the files currfile.dtx, currfile.ins
%% and the derived file currfile.sty.
%%
-%% $Id: currfile.dtx 2006 2011-01-03 22:54:46Z martin $
+%% $Id: currfile.dtx 2036 2011-01-09 17:51:42Z martin $
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{currfile}
- [2011/01/03 v0.3 Current input file name and path]
+ [2011/01/09 v0.4 Current input file name and path]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=currfile,prefix=currfile@}
@@ -39,7 +39,7 @@
\DeclareBoolOption[false]{fink}%
}%
\DeclareVoidOption{force}{\PassOptionsToPackage{force}{filehook}}
-\RequirePackage{filehook}[2011/01/03]
+\RequirePackage{filehook}[2011/01/09]
\ProcessKeyvalOptions*\relax
\begingroup
@@ -59,7 +59,9 @@
}
\def\currfile@set#1{%
\begingroup
- \filename@parse{#1}%
+ \edef\@tempa{#1}%
+ \@onelevel@sanitize\@tempa
+ \expandafter\filename@parse\expandafter{\@tempa}%
\global\let\currfiledir\filename@area
\global\let\currfilebase\filename@base
\xdef\currfileext{\ifx\filename@ext\relax tex\else\filename@ext\fi}%
@@ -95,6 +97,28 @@
\currfile@set{\currfile@maindir\jobname.\currfile@mainext}
\currfile@push
\let\currfile@stackinit\currfile@stack
+\newcommand*\ifcurrfilename{\begingroup\currfile@if\currfilename}
+\newcommand*\ifcurrfilebase{\begingroup\currfile@if\currfilebase}
+\newcommand*\ifcurrfileext{\begingroup\currfile@if\currfileext}
+\newcommand*\ifcurrfiledir{\begingroup\currfile@if\currfiledir}
+\newcommand*\ifcurrfilepath{\begingroup\currfile@if\currfilepath}
+\newcommand*\ifcurrfile[1]{%
+ \begingroup
+ \edef\@tempb{#1}%
+ \@onelevel@sanitize\@tempb
+ \currfile@if\@tempb
+}
+\def\currfile@if#1#2{%
+ \edef\@tempa{#2}%
+ \@onelevel@sanitize\@tempa
+ \ifx\@tempa#1%
+ \endgroup
+ \expandafter\@firstoftwo
+ \else
+ \endgroup
+ \expandafter\@secondoftwo
+ \fi
+}
\ifcurrfile@fink
\def\finkfile{\currfilename}%
\def\finkdir{\currfiledir}%
@@ -104,7 +128,7 @@
\@ifpackageloaded{fink}{%
\def\fink@restore#1{}%
}{%
- \@namedef{ver@fink.sty}{2011/01/03}%
+ \@namedef{ver@fink.sty}{2011/01/09}%
\expandafter\edef\csname opt@fink.sty\endcsname{%
maindir=\currfile@maindir,mainext=\currfile@mainext
}%