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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
%%
%% This is file `efbox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% efbox.dtx (with options: `package')
%%
%% This is a generated file.
%%
%% Copyright (C) 2014 by José Romildo Malaquias <malaquias@gmail.com>
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% 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.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{efbox}
[2014/03/19 1.0 An enhanced fbox command.]
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{efbox}[2014/03/19 v1.0 An enhanced fbox command]
\RequirePackage{color}
\RequirePackage{pgfkeys}
\newif\if@efbox@leftline
\newif\if@efbox@rightline
\newif\if@efbox@topline
\newif\if@efbox@bottomline
\pgfkeys{
/efbox/.cd,
leftline/.is if = @efbox@leftline,
rightline/.is if = @efbox@rightline,
topline/.is if = @efbox@topline,
bottomline/.is if = @efbox@bottomline,
hidealllines/.style = {leftline=false,rightline=false,topline=false,bottomline=false},
backgroundcolor/.store in = \efbox@backgroundcolor,
linecolor/.store in = \efbox@linecolor,
linewidth/.store in = \efbox@linewidth,
margin/.store in = \efbox@margin,
font/.store in = \efbox@font,
baselinestretch/.store in = \efbox@baselinestretch,
}
\pgfqkeys{/efbox}{
leftline = true,
rightline = true,
topline = true,
bottomline = true,
linecolor = black,
linewidth = \fboxrule,
margin = \fboxsep,
}
\newif\if@efbox@hasframe
\def\efbox@global@options{}
\newcommand\efboxsetup[1]{%
\def\efbox@global@options{#1}%
}%
\newcommand*\mypgfqkeys@with@saved@options[3]{%
% #1 => path
% #2 => macro holding saved options
% #3 => keys
\def\@pgfqkeys@##1{\pgfqkeys{#1}{##1}}%
\expandafter\@pgfqkeys@\expandafter{#2,#3}%
}%
\newcommand\efbox[2][]{%
\begingroup%
\mypgfqkeys@with@saved@options{/efbox}{\efbox@global@options}{#1}%
%\expandafter\pgfqkeys\expandafter{/efbox}\expandafter{\efbox@global@options,#1}%
\ifdefined\efbox@font\efbox@font\fi
\ifdefined\efbox@baselinestretch
\def\baselinestretch{\efbox@baselinestretch}%
\fi
\@efbox@hasframefalse
\if@efbox@topline\@efbox@hasframetrue\else\fi
\if@efbox@bottomline\@efbox@hasframetrue\else\fi
\if@efbox@leftline\@efbox@hasframetrue\else\fi
\if@efbox@rightline\@efbox@hasframetrue\else\fi
\ifdefined\efbox@backgroundcolor\@efbox@hasframetrue\else\fi
\if@efbox@hasframe
\ifdefined\efbox@backgroundcolor\else\def\efbox@backgroundcolor{white}\fi
\fboxsep=\efbox@margin
\fboxrule=\efbox@linewidth
\let\@frameb@x\@my@frameb@x
\fboxsep=\efbox@margin
\def\efbox@body{\fcolorbox{\efbox@linecolor}{\efbox@backgroundcolor}{#2}}%
\else
\def\efbox@body{#2}%
\fi
\ifdefined\efbox@title
\ifx\@empty\efbox@title
\noindent\efbox@body
\else
\vbox{%
\nobreak\vskip\fboxsep
\rlap{\frametitle{\efbox@title}}%
\nobreak\nointerlineskip
\vskip-\baselineskip
\vskip \fboxsep
\noindent\efbox@body
}%
\fi
\else
\efbox@body
\fi
\endgroup
}
\def\@my@frameb@x#1{%
\@tempdima\fboxrule
\advance\@tempdima\fboxsep
\advance\@tempdima\dp\@tempboxa
\hbox{%
\lower\@tempdima\hbox{%
\vbox{%
\if@efbox@topline\hrule\@height\fboxrule\fi
\hbox{%
\if@efbox@leftline\vrule\@width\fboxrule\fi
#1%
\vbox{%
\vskip\fboxsep
\box\@tempboxa
\vskip\fboxsep}%
#1%
\if@efbox@rightline\vrule\@width\fboxrule\fi
}%
\if@efbox@bottomline\hrule\@height\fboxrule\fi
}%
}%
}%
}%
\endinput
%%
%% End of file `efbox.sty'.
|