Debian Codegraph @

texmf-dist/tex/latex/fadingimage/fadingimage.sty

raw
1 %% ***********************************************************
2 %% Copyright 2024 by Mingyu Hsia <[email protected]> *
3 %% *
4 %% This work may be distributed and/or modified under *
5 %% the conditions of the LaTeX Project Public License *
6 %% *
7 %% http://www.latex-project.org/lppl.txt *
8 %% *
9 %% either version 1.3c of this license or any later *
10 %% version. *
11 %% *
12 %% This work has the LPPL maintenance status `maintained'. *
13 %% *
14 %% The Current Maintainer of this work is Mingyu Hsia. *
15 %% *
16 %% This work consists of the files fadingimage.sty, *
17 %% and README.md. *
18 %% available at https://github.com/xiamyphys/fadingimage *
19 %% ***********************************************************
20 % !Mode:: "TeX:UTF-8"
21 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
22 \ProvidesPackage{fadingimage}[2024/05/06/ v0.3a Package provides macros for inputting full width picture at the edges of pages quickly.]
23
24 \RequirePackage{tikz}\usetikzlibrary{fadings}
25 \NewDocumentCommand{\UPFadingImage}{ s O{} m t! }{
26 \IfBooleanTF{#4}{
27 \tikz[remember picture,overlay]
28 \node[below,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth,#2]{#3}};
29 }{
30 \tikz[remember picture,overlay]
31 \node[scope fading=south,below,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth,#2]{#3}};
32 }\IfBooleanT{#1}{\leavevmode}
33 }
34 \NewDocumentCommand{\LOWFadingImage}{ s O{} m t! }{
35 \IfBooleanTF{#4}{
36 \tikz[remember picture,overlay]
37 \node[above,inner sep=0pt,outer sep=auto] at (current page.south) {\includegraphics[width=\paperwidth,#2]{#3}};
38 }{
39 \tikz[remember picture,overlay]
40 \node[scope fading=north,above,inner sep=0pt,outer sep=auto] at (current page.south) {\includegraphics[width=\paperwidth,#2]{#3}};
41 }\IfBooleanT{#1}{\leavevmode}
42 }
43 \NewDocumentCommand{\LTFadingImage}{ s O{} m t! }{
44 \IfBooleanTF{#4}{
45 \tikz[remember picture,overlay]
46 \node[right,inner sep=0pt,outer sep=auto] at (current page.west) {\includegraphics[height=\paperheight,#2]{#3}};
47 }{
48 \tikz[remember picture,overlay]
49 \node[scope fading=east,right,inner sep=0pt,outer sep=auto] at (current page.west) {\includegraphics[height=\paperheight,#2]{#3}};
50 }\IfBooleanT{#1}{\leavevmode}
51 }
52 \NewDocumentCommand{\RITFadingImage}{ s O{} m t! }{
53 \IfBooleanTF{#4}{
54 \tikz[remember picture,overlay]
55 \node[left,inner sep=0pt,outer sep=auto] at (current page.east) {\includegraphics[height=\paperheight,#2]{#3}};
56 }{
57 \tikz[remember picture,overlay]
58 \node[scope fading=west,left,inner sep=0pt,outer sep=auto] at (current page.east) {\includegraphics[height=\paperheight,#2]{#3}};
59 }\IfBooleanT{#1}{\leavevmode}
60 }