summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fadingimage/doc/fadingimage.tex
blob: a5a88ec226ef8c5a733a5279e3393393c05b12c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\documentclass[11pt]{article}
\usepackage{geometry,indentfirst,titlesec,authblk,hyperref}
\titleformat*{\section}{\bfseries\large}
\usepackage{datetime}
\usepackage[libertine,mono=false]{libertine}
\usepackage{fadingimage}
\hypersetup{colorlinks,urlcolor=moducolor}
\definecolor{pkgcolor}{Hsb}{103,.8,.5}
\definecolor{moducolor}{Hsb}{290,.8,.5}
\definecolor{cmdcolor}{Hsb}{188,.8,.5}
\def\pkg#1{\texorpdfstring{\textcolor{pkgcolor}{
    \href{https://ctan.org/pkg/#1}{\textsf{#1}}}}{“#1”}}
\def\mode#1{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}}
\def\cmd#1{\texorpdfstring{\textcolor{cmdcolor}{\textsf{#1}}}{“#1”}}
\def\datechange#1#2{%
  \noindent{\makebox[\textwidth][r]{\color{H7}\rule{1.15\textwidth}{.4pt}}}
  \noindent\makebox[0pt][r]{\makebox[-3em][r]{\small\textbf{\textcolor{H7}{#1}}}\;\;}{\sffamily Update: \ignorespaces#2}}

\title{\bfseries The \pkg{FadingImage} Package}
\author{Hsia Mingyu, \href{https://www.hdu.edu.cn}{Hangzhou Dianzi University}}
\yyyymmdddate\date{\today}
\affil{\href{mailto:xiamyphys@gmail.com}{\ttfamily xiamyphys@gmail.com}}
\date{\today\quad Version 0.1c\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}

\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}.
\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@gmail.com}{\ttfamily xiamyphys@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
\begin{verbatim}
  sudo tlmgr update --self --all
\end{verbatim}

\section{Commands \cmd{UPFadingImage} \& \cmd{LOWFadingImage}}
\begin{verbatim}
  \UPFadingImage[ ]{example-image-a} \LOWFadingImage[ ]{example-image-a}
\end{verbatim}

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}

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}}.

\end{document}