texlive[70674] Master/texmf-dist: fadingimage (17mar24)

commits+karl at tug.org commits+karl at tug.org
Sun Mar 17 20:48:33 CET 2024


Revision: 70674
          https://tug.org/svn/texlive?view=revision&revision=70674
Author:   karl
Date:     2024-03-17 20:48:32 +0100 (Sun, 17 Mar 2024)
Log Message:
-----------
fadingimage (17mar24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fadingimage/fadingimage.pdf
    trunk/Master/texmf-dist/doc/latex/fadingimage/fadingimage.tex
    trunk/Master/texmf-dist/tex/latex/fadingimage/fadingimage.sty

Modified: trunk/Master/texmf-dist/doc/latex/fadingimage/fadingimage.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/fadingimage/fadingimage.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fadingimage/fadingimage.tex	2024-03-17 19:48:22 UTC (rev 70673)
+++ trunk/Master/texmf-dist/doc/latex/fadingimage/fadingimage.tex	2024-03-17 19:48:32 UTC (rev 70674)
@@ -20,8 +20,9 @@
 \author{Hsia Mingyu, \href{https://www.hdu.edu.cn}{Hangzhou Dianzi University}}
 \yyyymmdddate\date{\today}
 \affil{\href{mailto:xiamyphys at gmail.com}{\ttfamily xiamyphys at gmail.com}}
-\date{\today\quad Version 0.1c\thanks{\url{https://github.com/xiamyphys/FadingImage}}}
+\date{\today\quad Version 0.1d\thanks{\url{https://github.com/xiamyphys/FadingImage}}}
 \begin{document}
+
 \maketitle
 \UPFadingImage[trim={0 {.96\paperheight} 0 0},clip]{Beautiful-realities}
 \LOWFadingImage[trim={0 0 0 {.96\paperheight}},clip]{Beautiful-realities}
@@ -28,30 +29,32 @@
 
 \vspace{-6ex}
 \begin{abstract}
-This is \textsf{\textbf{not only the document but also the demo}} for \pkg{FadingImage} package, which provides two commands for adding fading full width picture at the top or bottom of a page. And this package is a component of my template \pkg{LiteBook}.
+This is \textsf{\textbf{not only the document but also the demo}} for the \pkg{FadingImage} package, which provides three commands for adding fading full width picture at the top, bottom or both of them on a page. And this package is used for my template \pkg{LiteBook} and \pkg{LiteSolution}.
 \end{abstract}
 
 \section{The purpose of this package}
-This package provides two commands for adding fading full width picture at the top or bottom of a page. Welcome to feedback bugs or ideas via email \href{mailto:xiamyphys at gmail.com}{\ttfamily xiamyphys at gmail.com} or \href{https://github.com/xiamyphys/fadingimage}{GitHub}.
+This package provides three commands for adding fading full width picture at the top or bottom of a page. Welcome to feedback bugs or ideas via email \href{mailto:xiamyphys at gmail.com}{\ttfamily xiamyphys at gmail.com} or \href{https://github.com/xiamyphys/fadingimage}{GitHub}.
 
 This package requires \pkg{tikz} package to node images and \pkg{fading} library to support fading image.
 
 \section{Loading \pkg{FadingImage}}
-You can simply download latest \verb|fadingimage.sty| file from \href{https://github.com/xiamyphys/FadingImage}{GitHub} or \href{https://ctan.org/pkg/fadingimage}{CTAN} and save it under your working directory, or using terminal/cmd to implement the commands to update all the packages (and install this package) to the latest version or switch to portable version instead
+I strongly advise you to use terminal/cmd to implement the commands to update all the packages (and install this package) to the latest version or switch to portable version instead
 \begin{verbatim}
   sudo tlmgr update --self --all
 \end{verbatim}
 
-\section{Commands \cmd{UPFadingImage} \& \cmd{LOWFadingImage}}
+\section{Commands \cmd{UPFadingImage}, \cmd{LOWFadingImage} and \cmd{UPLOWFadingImage}}
+\begin{small}
 \begin{verbatim}
-  \UPFadingImage[ ]{example-image-a} \LOWFadingImage[ ]{example-image-a}
+  \UPFadingImage [<keyval list>]{<file>} \LOWFadingImage[<keyval list>]{<file>}
+  \UPFadingImage [<keyval list>]{<file>} [<keyval list>]{<file>}
 \end{verbatim}
+\end{small}
 
-The two commands are all have 2 variables, while the first one is optional. The second variable of the commands can assign the image that you want to insert, and the first one can assign the parameters of command \cmd{includegraphics}, such as clip to the inserted image
-\begin{verbatim}
-  \UPFadingImage[trim={0 {.75\paperheight} 0 0},clip]{example-image-a}[.5]
-\end{verbatim}
+The first two commands all have 2 variables and the first one is optional. The second variable of the commands can assign the image that you want to insert, and the first one can assign the parameters of command \cmd{includegraphics}, such as clip to the inserted image.
 
-If a star (*) is added after the commands (such as \verb|\UPFadingImage*[...]{...}|), then the image you inserted won't be faded. \textbf{\textsf{The effect of the commands is just like this document}}.
+The third command is a combination of the first two commands and it will call the \cmd{tikz} environment for only once time to reduce compile time.
 
+If a star (*) is added after the commands (such as \verb|\UPFadingImage*[...]{...}|), then the image you inserted won't be faded.
+
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/fadingimage/fadingimage.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fadingimage/fadingimage.sty	2024-03-17 19:48:22 UTC (rev 70673)
+++ trunk/Master/texmf-dist/tex/latex/fadingimage/fadingimage.sty	2024-03-17 19:48:32 UTC (rev 70674)
@@ -18,12 +18,13 @@
 %%   available at https://github.com/xiamyphys/FadingImage                                            *
 %% ****************************************************************************************************
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesPackage{fadingimage}[2024/03/11/ v0.1c Package for adding fading full width picture at the top or bottom of a page.]
+\ProvidesPackage{fadingimage}[2024/03/17/ v0.1d Package for adding fading full width picture at the top or bottom of a page.]
 
 \RequirePackage{tikz,xcolor}
 \usetikzlibrary{fadings}
 \NewDocumentCommand{\UPFadingImage}{ s O{} m }{
-    \IfBooleanTF{#1}{
+    \IfBooleanTF{#1}
+    {
         \tikz[remember picture,overlay]
             \node[below,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth,#2]{#3}};
     }{
@@ -31,8 +32,10 @@
             \node[scope fading=south,below,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth,#2]{#3}};
     }
 }
+
 \NewDocumentCommand{\LOWFadingImage}{ s O{} m }{
-    \IfBooleanTF{#1}{
+    \IfBooleanTF{#1}
+    {
         \tikz[remember picture,overlay]
             \node[above,inner sep=0pt,outer sep=auto] at (current page.south) {\includegraphics[width=\paperwidth,#2]{#3}};
     }{
@@ -39,4 +42,19 @@
         \tikz[remember picture,overlay]
             \node[scope fading=north,above,inner sep=0pt,outer sep=auto] at (current page.south) {\includegraphics[width=\paperwidth,#2]{#3}};
     }
+}
+
+\NewDocumentCommand{\UPLOWFadingImage}{ s O{} m O{} m }{
+    \IfBooleanTF{#1}
+    {
+        \tikz[remember picture,overlay]{
+            \node[below,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth,#2]{#3}};
+            \node[above,inner sep=0pt,outer sep=auto] at (current page.south) {\includegraphics[width=\paperwidth,#4]{#5}};
+        }
+    }{
+        \tikz[remember picture,overlay]{
+            \node[scope fading=south,below,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth,#2]{#3}};
+            \node[scope fading=north,above,inner sep=0pt,outer sep=auto] at (current page.south) {\includegraphics[width=\paperwidth,#4]{#5}};
+        }
+    }
 }
\ No newline at end of file



More information about the tex-live-commits mailing list.