Debian Codegraph @

texmf-dist/tex/latex/filehook/filehook-fink.sty

raw
1 %% Copyright (c) 2011-2022 by Martin Scharrer <[email protected]>
2 %% ----------------------------------------------------------------------
3 %% This work may be distributed and/or modified under the
4 %% conditions of the LaTeX Project Public License, either version 1.3
5 %% of this license or (at your option) any later version.
6 %% The latest version of this license is in
7 %% http://www.latex-project.org/lppl.txt
8 %% and version 1.3 or later is part of all distributions of LaTeX
9 %% version 2005/12/01 or later.
10 %%
11 %% This work has the LPPL maintenance status `maintained'.
12 %%
13 %% The Current Maintainer of this work is Martin Scharrer.
14 %%
15 %% This work consists of the files filehook.dtx and filehook.ins
16 %% and the derived files filehook.sty, filehook-fink.sty,
17 %% filehook-listings.sty, filehook-memoir.sty, filehook-scrlfile.sty
18 %% and pgf-filehook.sty
19 %%
20 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
21 \ProvidesPackage{filehook-fink}[011/01/03 v0.1 filehook compatibility code for fink package]
22 \RequirePackage{filehook}
23 \RequirePackage{currfile}%
24
25 \begingroup
26
27 \long\def\fink@old@InputIfFileExists#1#2{%
28 \IfFileExists{#1}{%
29 #2\@addtofilelist{#1}%
30 \fink@prepare{#1}%
31 \expandafter\fink@input%
32 \expandafter\fink@restore\expandafter{\finkpath}}%
33 }
34
35 \long\def\fink@new@InputIfFileExists#1#2{%
36 \IfFileExists{#1}{%
37 #2\@addtofilelist{#1}%
38 \edef\fink@before{\noexpand\fink@input{#1}}%
39 \edef\fink@after{\noexpand\fink@restore{\finkpath}}%
40 \expandafter\fink@before\fink@after}%
41 }
42
43 \ifcase
44 \ifx\InputIfFileExists\filehook@InputIfFileExists 0\else
45 \ifx\InputIfFileExists\latex@InputIfFileExists 1\else
46 \ifx\InputIfFileExists\fink@new@InputIfFileExists 1\else
47 \ifx\InputIfFileExists\fink@old@InputIfFileExists 1\else
48 1%
49 \fi\fi\fi\fi
50 \relax
51 \or
52 \global\let\filehook@InputIfFileExists\filehook@default@InputIfFileExists
53 \global\let\filehook@@InputIfFileExists\filehook@@default@InputIfFileExists
54 \global\let\InputIfFileExists\filehook@InputIfFileExists
55 \PackageInfo{filehook-fink}{Package 'fink' detected and replaced by 'currfile'}%
56 \else
57 \iffilehook@force
58 \global\let\filehook@InputIfFileExists\filehook@default@InputIfFileExists
59 \global\let\filehook@@InputIfFileExists\filehook@@default@InputIfFileExists
60 \global\let\InputIfFileExists\filehook@InputIfFileExists
61 \PackageWarning{filehook-fink}{Detected 'fink' package with unknown definition of \string\InputIfFileExists.^^J%
62 The 'force' option of 'filehook' is in effect. Macro is overwritten with default!}%
63 \else
64 \PackageError{filehook-fink}{Detected 'fink' package with unknown definition of \string\InputIfFileExists.^^J%
65 Use the 'force' option of 'filehook' to overwrite it.}{}%
66 \fi
67 \fi
68
69 \endgroup
70 \endinput
71 %%
72 %% End of file `filehook-fink.sty'.