summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/inversepath
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-04-28 00:52:36 +0000
committerKarl Berry <karl@freefriends.org>2007-04-28 00:52:36 +0000
commitca6449b1a40c3ba024f1819af6ff8b7b2ddc22e6 (patch)
treebcc1e0c2925ba96fa89e667fbaa9dd847de587a6 /Master/texmf-dist/tex/latex/inversepath
parent82a154912da337be00dd632c0a3b2534acdf57c0 (diff)
new package inversepath (26apr07)
git-svn-id: svn://tug.org/texlive/trunk@4204 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/inversepath')
-rw-r--r--Master/texmf-dist/tex/latex/inversepath/inversepath.sty75
1 files changed, 75 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/inversepath/inversepath.sty b/Master/texmf-dist/tex/latex/inversepath/inversepath.sty
new file mode 100644
index 00000000000..dc011e4421f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/inversepath/inversepath.sty
@@ -0,0 +1,75 @@
+%%
+%% This is file `inversepath.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% inversepath.dtx (with options: `package')
+%%
+%% __________________________________
+%% Copyright (C) 2007 Will Robertson
+%%
+%% License information appended.
+%%
+\ProvidesPackage{inversepath}
+ [26/04/2007 v0.1 Inverse relative paths]
+\newcommand\inversepath[1]{%
+ \let\ip@origjobpath\ip@jobpath
+ \let\ip@directpath\@empty
+ \let\ip@inversepath\@empty
+ \ip@strippath#1/\@nil/%
+ \let\ip@jobpath\ip@origjobpath
+ \ip@inversepath}
+\newcommand\absolutepath[1]{\def\ip@jobpath{#1}}
+\def\ip@literaldotdot{..}
+\def\ip@strippath#1/#2/{%
+ \ifx\@nil#2\relax
+ \def\ip@lastelement{#1}%
+ \else
+ \edef\ip@directpath{\ip@directpath#1/}
+ \def\@tempa{#1}%
+ \ifx\@tempa\ip@literaldotdot
+ \unless\ifdefined\ip@jobpath
+ \PackageError{inversepath}
+ {No absolute path specified}
+ {You must declare the file path of the main
+ file with \protect\absolutepath{} to be able to
+ resolve back-relative paths}%
+ \fi
+ \let\ip@olddirectpath\ip@directpath
+ \let\ip@oldinversepath\ip@inversepath
+ \let\ip@directpath\@empty
+ \let\ip@inversepath\@empty
+ \expandafter\ip@strippath\ip@jobpath\@nil/
+ \let\@tempa\ip@lastelement
+ \let\ip@jobpath\ip@directpath
+ \let\ip@directpath\ip@olddirectpath
+ \let\ip@inversepath\ip@oldinversepath
+ \ifx\@tempa\@empty
+ \PackageError{inversepath}
+ {Absolute path too shallow to resolve
+ such a deep relative path}
+ {You're trying to go back more directories than you have!}
+ \fi
+ \edef\ip@inversepath{\@tempa/\ip@inversepath}%
+ \else
+ \edef\ip@inversepath{../\ip@inversepath}%
+ \fi
+ \def\@tempa{\ip@strippath#2/}%
+ \expandafter\@tempa
+ \fi}
+%%
+%% Copyright (C) 2006 by Will Robertson <wspr81@gmail.com>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Will Robertson.
+%%
+%% This work consists of the file inversepath.dtx
+%% and the derived files inversepath.sty and inversepath.pdf.
+%%
+%%
+%% End of file `inversepath.sty'.