Debian Codegraph @

texmf-dist/tex/latex/filehook/filehook-memoir.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-memoir}[2020/02/02 v0.2 filehook patch for memoir class]
22 \RequirePackage{filehook}
23 \begingroup
24 \ifcsname InputIfFileExists\space\endcsname
25 \DeclareRobustCommand \memoir@InputIfFileExists[2]{%
26 \IfFileExists{#1}%
27 {%
28 \expandafter\@swaptwoargs\expandafter
29 {\@filef@und\m@matendf{#1}\killm@matf{#1}}{%
30 #2\@addtofilelist{#1}\m@matbeginf{#1}\@@input%
31 }%
32 }%
33 }
34 \else
35 % Old definition
36 \renewcommand{\memoir@InputIfFileExists}[2]{%
37 \IfFileExists{#1}%
38 {#2\@addtofilelist{#1}\m@matbeginf{#1}%
39 \@@input \@filef@und
40 \m@matendf{#1}%
41 \killm@matf{#1}}%
42 }
43 \fi
44 \@tempswafalse
45 \filehook@cmp{InputIfFileExists}{filehook@InputIfFileExists}%
46 {\@tempswatrue}%
47 {%
48 \filehook@cmp{InputIfFileExists}{memoir@InputIfFileExists}%
49 {\@tempswatrue}%
50 {}%
51 }%
52
53 \if@tempswa
54 \filehook@glet{filehook@InputIfFileExists}{filehook@default@InputIfFileExists}%
55 \filehook@glet{filehook@@InputIfFileExists}{filehook@@default@InputIfFileExists}%
56 \filehook@glet{InputIfFileExists}{filehook@InputIfFileExists}%
57 \filehook@appendwarg\filehook@atbegin{\m@matbeginf{#1}}%
58 \filehook@prefixwarg\filehook@atend{\m@matendf{#1}\killm@matf{#1}}%
59 \PackageInfo{filehook}{Detected 'memoir' class: the memoir hooks will be moved to the `At...OfFiles' hooks}
60 \else
61 \iffilehook@force
62 \filehook@glet{filehook@InputIfFileExists}{filehook@default@InputIfFileExists}%
63 \filehook@glet{filehook@@InputIfFileExists}{filehook@@default@InputIfFileExists}%
64 \filehook@glet{InputIfFileExists}{filehook@InputIfFileExists}%
65 \PackageWarning{filehook}{Detected 'memoir' class with unknown definition of \string\InputIfFileExists.^^J%
66 The 'force' option of 'filehook' is in effect. Macro is overwritten with default!}%
67 \else
68 \PackageError{filehook}{Detected 'memoir' class with unknown definition of \string\InputIfFileExists.^^J%
69 Use the 'force' option of 'filehook' to overwrite it.}{}%
70 \fi
71 \fi
72 \endgroup
73 \endinput
74 %%
75 %% End of file `filehook-memoir.sty'.