%% %% This is file `inversepath.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% inversepath.dtx (with options: `package') %% %% _______________________________________ %% Copyright (C) 2007-2008 Will Robertson %% %% License information appended. %% %% \ProvidesPackage{inversepath} [2008/07/31 v0.2 Inverse relative paths] \newcommand\inversepath{% \@ifstar{\inversepath@star}{\inversepath@nostar}} \newcommand\inversepath@star[1]{% \let\ip@origjobpath\ip@jobpath \let\ip@directpath\@empty \let\ip@inversepath\@empty \ip@strippath#1/\@nil/% \let\ip@jobpath\ip@origjobpath} \newcommand\inversepath@nostar[1]{% \inversepath@star{#1}% \let\ip@jobpath\ip@origjobpath} \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) 2007-2008 by Will Robertson %% %% 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'.