summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gradientframe/gradientframe.sty
blob: 2df7d257a2fe88aebbdbb1d4b12883ca703d8332 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
%%
%% This is file `gradientframe.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% gradientframe.dtx  (with options: `package')
%% 
%% LaTeX package gradientframe for simple rectangular gradient frames around objects.
%% 
%% Copyright (C) Christian Raue, 2011
%% Send feedback to christian°raue@gmail°com (after being exposed to gravity).
%% 
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version.  The latest version of this license is in:
%% 
%% http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainer of this work is Christian Raue.
%% 
%% This work consists of gradientframe.dtx and the derived file
%% gradientframe.sty.
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{gradientframe}[2011/02/13 v0.2 simple gradient frames around objects]
\RequirePackage{color}
\RequirePackage{keyval}
\define@key{gradientframe}{linewidth}{%
\newdimen\gradientframe@linewidth%
\setlength{\gradientframe@linewidth}{#1}%
}%
\define@key{gradientframe}{padding}{%
\newdimen\gradientframe@padding%
\setlength{\gradientframe@padding}{#1}%
}%
\newcommand{\gradientframe@defaults}{%
\setkeys{gradientframe}{%
linewidth=0.3px,%
padding=0mm%
}%
}%
\newdimen\gradientframe@origlinewidth%
\newcommand{\gradientframe@drawbox}[3]{%
\fcolorbox[gray]{#1}{#2}{%
#3%
}%
}%
\newcommand{\gradientframe}[2][]{%
\gradientframe@defaults% apply defaults
\setkeys{gradientframe}{#1}%
\begingroup% limit redefinitions to this block
\setlength{\gradientframe@origlinewidth}{\fboxrule}%
\setlength{\fboxrule}{\gradientframe@linewidth}%
\setlength{\fboxsep}{\gradientframe@linewidth}% space between frame and object
\gradientframe@drawbox{.98}{.96}{%
\gradientframe@drawbox{.94}{.92}{%
\gradientframe@drawbox{.90}{.88}{%
\gradientframe@drawbox{.86}{.84}{%
\gradientframe@drawbox{.82}{.80}{%
\gradientframe@drawbox{.78}{.76}{%
\gradientframe@drawbox{.74}{.72}{%
\setlength{\fboxrule}{\gradientframe@origlinewidth}% restore original \fboxrule value
\setlength{\fboxsep}{\gradientframe@padding}%
\gradientframe@drawbox{.70}{1}{#2}%
}%
}%
}%
}%
}%
}%
}%
\endgroup%
}%
\endinput
%%
%% End of file `gradientframe.sty'.