blob: 20afd0145906682ec1421fb73a0941ece76d41db (
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
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
135
136
137
138
139
140
|
%%
%% This is file `niceframe.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% niceframe.dtx (with options: `package')
%%
%% This file is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%%
%% 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.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Marcus Ohlhaut.
%%
%% This work consists of the files niceframe.dtx and niceframe.ins
%% and the derived file niceframe.sty.
%%
%% Copyright (C) 2009 Marcus Ohlhaut (marcus@ohlhaut.de).
%% All rights reserved.
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
\def\fileversion{1.1c}
\def\filedate{2009/31/08}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{niceframe}[\filedate\space v\fileversion\space niceframe package (MO)]
\typeout{Package: niceframe v\fileversion\space <\filedate> (Marcus Ohlhaut)}
\RequirePackage{calc}
\font\ding dingbat scaled 1200
\newlength{\nicefr@mechar}
\settowidth{\nicefr@mechar}{\ding\char'141}
\newlength{\nicefr@mewidth}
\setlength{\nicefr@mewidth}{\hsize}
\newlength{\nicefr@meheight}
\setlength{\nicefr@meheight}{\vsize}
\newlength{\@ldhsize}
\setlength{\@ldhsize}{\hsize}
\newcommand{\upd@ublerulefill}{\xleaders\hbox to 10pt
{\hss\ding\char'142 \hss}\hfill}
\newcommand{\dnd@ublerulefill}{\xleaders\hbox to 10pt
{\hss\ding\char'147 \hss}\hfill}
\newcommand{\ltd@ublerulefill}{\xleaders\vbox to 10pt
{\vss\hbox{\ding\char'144}\vss}\vfill}
\newcommand{\rtd@ublerulefill}{\xleaders\vbox to 10pt
{\vss\hbox{\ding\char'145}\vss}\vfill}
\newcommand{\niceframe}[2][\textwidth]{{
\setlength{\hsize}{#1 - 2\nicefr@mechar}
\setbox0=\vbox{#2}
\setlength{\nicefr@meheight}{\ht0 + \dp0}
\setlength{\nicefr@mewidth}{\wd0 + 2\nicefr@mechar}
\vbox{%
\hbox to\nicefr@mewidth{\ding\char'141\upd@ublerulefill\char'143}
\hbox to\nicefr@mewidth{\vbox to\nicefr@meheight{\ltd@ublerulefill}
\hss\raise\dp0\box0\hss
\vbox to\nicefr@meheight{\rtd@ublerulefill}}
\hbox to\nicefr@mewidth{\ding\char'146\dnd@ublerulefill\char'150}
}
}}
\newcommand{\curlyframe}[2][\textwidth]{{
\setlength{\hsize}{#1 - 2\nicefr@mechar}
\setbox0=\vbox{#2}
\setlength{\nicefr@meheight}{\ht0 + \dp0}
\setlength{\nicefr@mewidth}{\wd0 + 2\nicefr@mechar}
\vbox{%
\hbox to\nicefr@mewidth{\ding\char'105\hfill\char'106}
\vskip-\baselineskip
\hbox to\nicefr@mewidth{\hss\raise\dp0\box0\hss}
\vskip-\baselineskip
\hbox to\nicefr@mewidth{\ding\char'110\hfill\char'107}
}
}}
\newcommand{\artdecoframe}[2][\textwidth]{{
\setlength{\hsize}{#1 - 2\nicefr@mechar}
\setbox0=\vbox{#2}
\setlength{\nicefr@meheight}{\ht0 + \dp0}
\setlength{\nicefr@mewidth}{\wd0 + 2\nicefr@mechar}
\vbox{%
\hbox to\nicefr@mewidth{\ding\char'115\hfill\char'114}
\hbox to\nicefr@mewidth{\hss\raise\dp0\box0\hss}
\hbox to\nicefr@mewidth{\ding\char'112\hfill\char'113}
}
}}
\newcounter{times}
\newlength{\fr@mecharTT}
\newlength{\fr@mecharLL}
\newlength{\fr@mewidth}
\newlength{\fr@meheight}
\newcommand{\generalframe}[9]{{
\settowidth{\fr@mecharTT}{#2}
\settoheight{\fr@mecharLL}{#4}
\setcounter{times}{1 * \ratio{\hsize}{\fr@mecharTT}}
\setlength{\fr@mewidth}{\fr@mecharTT * \value{times}}
\setlength{\hsize}{\fr@mewidth - 2\fr@mecharTT - 2\fboxsep}
\setbox0=\vbox{#9}
\setlength{\fr@meheight}{\ht0 + \dp0 + 2\fboxsep}
\setcounter{times}{1 * \ratio{\fr@meheight}{\fr@mecharLL}}
\setcounter{times}{\value{times} + 1}
\setlength{\fr@meheight}{\fr@mecharLL * \value{times}}
\newcommand{\up@fill}{\leaders\hbox{#2}\hfill}
\newcommand{\lt@fill}{\leaders\vbox{\hbox{#4}}\vfill}
\newcommand{\rt@fill}{\leaders\vbox{\hbox{#5}}\vfill}
\newcommand{\dn@fill}{\leaders\hbox{#7}\hfill}
\vbox{%
\hbox to\fr@mewidth{#1\up@fill#3}\nointerlineskip
\hbox to\fr@mewidth{\vbox to\fr@meheight{\lt@fill}%
\hfill%
\vbox to\fr@meheight{\vfill\box0\vfill}%
\hfill%
\vbox to\fr@meheight{\rt@fill}%
}\nointerlineskip
\hbox to\fr@mewidth{#6\dn@fill#8}\nointerlineskip
}
}}
\endinput
%%
%% End of file `niceframe.sty'.
|