1 %%% Derived from the original fncychap.sty,
2 %%% but changed ``TWELV'' to ``TWELVE''.
4 %%% Copyright Ulf A. Lindgren
5 %%% Department of Applied Electronics
6 %%% Chalmers University of Technology
7 %%% S-412 96 Gothenburg, Sweden
8 %%% E-mail lindgren@ae.chalmers.se
10 %%% Note Permission is granted to modify this file under
11 %%% the condition that it is saved using another
12 %%% file and package name.
16 %%% Jan. 8th Modified package name base date option
17 %%% Jan. 22th Modified FmN and FmTi for error in book.cls
18 %%% \MakeUppercase{#}->{\MakeUppercase#}
19 %%% Apr. 6th Modified Lenny option to prevent undesired
21 %%% Nov. 8th Fixed \@chapapp for AMS
22 %%% Feb. 11th Fixed appendix problem related to Bjarne
23 %%% Last modified Feb. 11th 1998
25 \NeedsTeXFormat{LaTeX2e
}[1995/
12/
01]
26 \ProvidesPackage{fncychap
}
28 LaTeX package (Revised chapters)
]
30 %%%% DEFINITION OF Chapapp variables
31 \newcommand{\CNV}{\huge\bfseries}
32 \newcommand{\ChNameVar}[1]{\renewcommand{\CNV}{#1}}
35 %%%% DEFINITION OF TheChapter variables
36 \newcommand{\CNoV}{\huge\bfseries}
37 \newcommand{\ChNumVar}[1]{\renewcommand{\CNoV}{#1}}
43 \def\ChNameLowerCase{\LCNtrue\UCNfalse}
44 \def\ChNameUpperCase{\UCNtrue\LCNfalse}
45 \def\ChNameAsIs{\UCNfalse\LCNfalse}
47 %%%%% Fix for AMSBook 971008
49 \@ifundefined
{@chapapp
}{\let\@chapapp
\chaptername}{}
52 %%%%% Fix for Bjarne and appendix 980211
56 \renewcommand\appendix{\par
57 \setcounter{chapter
}{0}%
58 \setcounter{section
}{0}%
60 \renewcommand\@chapapp
{\appendixname}%
61 \renewcommand\thechapter{\@Alph
\c@chapter
}}
65 \newcommand{\FmN}[1]{%
67 {\MakeUppercase#1}\LCNfalse
70 {\MakeLowercase#1}\UCNfalse
76 %%%% DEFINITION OF Title variables
77 \newcommand{\CTV}{\Huge\bfseries}
78 \newcommand{\ChTitleVar}[1]{\renewcommand{\CTV}{#1}}
80 %%%% DEFINITION OF the basic rule width
83 \newcommand{\ChRuleWidth}[1]{\setlength{\RW}{#1}}
89 \def\ChTitleLowerCase{\LCTtrue\UCTfalse}
90 \def\ChTitleUpperCase{\UCTtrue\LCTfalse}
91 \def\ChTitleAsIs{\UCTfalse\LCTfalse}
92 \newcommand{\FmTi}[1]{%
95 {\MakeUppercase#1}\LCTfalse
98 {\MakeLowercase#1}\UCTfalse
113 \def\mghrulefill#1{\leavevmode\leaders\hrule\@height
#1\hfill\kern\z@
}
116 \CNV\FmN{\@chapapp
}\space \CNoV\thechapter
120 \newcommand{\DOTI}[1]{%
121 \CTV\FmTi{#1}\par\nobreak
124 \newcommand{\DOTIS}[1]{%
125 \CTV\FmTi{#1}\par\nobreak
131 \DeclareOption{Sonny
}{%
132 \ChNameVar{\Large\sf}
134 \ChTitleVar{\Large\sf}
137 \renewcommand{\DOCH}{%
139 \CNV\FmN{\@chapapp
}\space \CNoV\thechapter
142 \renewcommand{\DOTI}[1]{%
143 \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
145 \CTV\FmTi{#1}\par\nobreak
146 \mghrulefill{\RW}\par\nobreak
148 \renewcommand{\DOTIS}[1]{%
149 \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
151 \CTV\FmTi{#1}\par\nobreak
152 \mghrulefill{\RW}\par\nobreak
158 \DeclareOption{Lenny
}{%
160 \ChNameVar{\fontsize{14}{16}\usefont{OT1
}{phv
}{m
}{n
}\selectfont}
161 \ChNumVar{\fontsize{60}{62}\usefont{OT1
}{ptm
}{m
}{n
}\selectfont}
162 \ChTitleVar{\Huge\bfseries\rm}
164 \renewcommand{\DOCH}{%
165 \settowidth{\px}{\CNV\FmN{\@chapapp
}}
166 \addtolength{\px}{2pt
}
167 \settoheight{\py}{\CNV\FmN{\@chapapp
}}
168 \addtolength{\py}{1pt
}
170 \settowidth{\mylen}{\CNV\FmN{\@chapapp
}\space\CNoV\thechapter}
171 \addtolength{\mylen}{1pt
}
172 \settowidth{\pxx}{\CNoV\thechapter}
173 \addtolength{\pxx}{-
1pt
}
175 \settoheight{\pyy}{\CNoV\thechapter}
176 \addtolength{\pyy}{-
2pt
}
177 \setlength{\myhi}{\pyy}
178 \addtolength{\myhi}{-
1\py}
180 \parbox[b
]{\textwidth}{%
181 \rule[\py]{\RW}{\myhi}%
183 \rule[\pyy]{\px}{\RW}%
186 \CNV\FmN{\@chapapp
}\space\CNoV\thechapter%
189 \rule{\RW}{\pyy}\par\nobreak%
190 \vskip -
\baselineskip%
193 \mghrulefill{\RW}\par\nobreak%
198 \renewcommand{\DOTI}[1]{%
200 \CTV\FmTi{#1}\par\nobreak
203 \renewcommand{\DOTIS}[1]{%
205 \CTV\FmTi{#1}\par\nobreak
213 \DeclareOption{Glenn
}{%
214 \ChNameVar{\bfseries\Large\sf}
216 \ChTitleVar{\bfseries\Large\rm}
220 \renewcommand{\DOCH}{%
221 \settoheight{\myhi}{\CTV\FmTi{Test
}}
222 \setlength{\py}{\baselineskip}
223 \addtolength{\py}{\RW}
224 \addtolength{\py}{\myhi}
225 \setlength{\pyy}{\py}
226 \addtolength{\pyy}{-
1\RW}
229 \CNV\FmN{\@chapapp
}\space\CNoV\thechapter
230 \hskip 3pt
\mghrulefill{\RW}\rule[-
1\pyy]{2\RW}{\py}\par\nobreak}
232 \renewcommand{\DOTI}[1]{%
233 \addtolength{\pyy}{-
4pt
}
234 \settoheight{\myhi}{\CTV\FmTi{#1}}
235 \addtolength{\myhi}{\py}
236 \addtolength{\myhi}{-
1\RW}
238 \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt
239 \raggedleft\CTV\FmTi{#1}\par\nobreak
242 \renewcommand{\DOTIS}[1]{%
243 \setlength{\py}{10pt
}
244 \setlength{\pyy}{\py}
245 \addtolength{\pyy}{\RW}
246 \setlength{\myhi}{\baselineskip}
247 \addtolength{\myhi}{\pyy}
248 \mghrulefill{\RW}\rule[-
1\py]{2\RW}{\pyy}\par\nobreak
250 \vskip -
1\baselineskip
251 \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt
252 \raggedleft\CTV\FmTi{#1}\par\nobreak
258 \DeclareOption{Conny
}{%
261 \ChNameVar{\centering\Huge\rm\bfseries}
263 \ChTitleVar{\centering\Huge\rm}
266 \renewcommand{\DOCH}{%
267 \mghrulefill{3\RW}\par\nobreak
268 \vskip -
0.5\baselineskip
269 \mghrulefill{\RW}\par\nobreak
270 \CNV\FmN{\@chapapp
}\space \CNoV\thechapter
272 \vskip -
0.5\baselineskip
274 \renewcommand{\DOTI}[1]{%
275 \mghrulefill{\RW}\par\nobreak
276 \CTV\FmTi{#1}\par\nobreak
279 \renewcommand{\DOTIS}[1]{%
280 \mghrulefill{\RW}\par\nobreak
281 \CTV\FmTi{#1}\par\nobreak
288 \DeclareOption{Rejne
}{%
292 \ChNameVar{\centering\Large\rm}
294 \ChTitleVar{\centering\Huge\rm}
296 \renewcommand{\DOCH}{%
297 \settoheight{\py}{\CNoV\thechapter}
298 \addtolength{\py}{-
1pt
}
299 \CNV\FmN{\@chapapp
}\par\nobreak
301 \setlength{\myhi}{2\baselineskip}
302 \setlength{\px}{\myhi}
303 \addtolength{\px}{-
1\RW}
304 \rule[-
1\px]{\RW}{\myhi}\mghrulefill{\RW}\hskip
305 10pt
\raisebox{-
0.5\py}{\CNoV\thechapter}\hskip
306 10pt
\mghrulefill{\RW}\rule[-
1\px]{\RW}{\myhi}\par\nobreak
309 \renewcommand{\DOTI}[1]{%
310 \setlength{\mylen}{\textwidth}
311 \addtolength{\mylen}{-
2\RW}
312 {\vrule width
\RW}\parbox{\mylen}{\CTV\FmTi{#1}}{\vrule
313 width
\RW}\par\nobreak
315 -
1pt
\rule{\RW}{2\baselineskip}\mghrulefill{\RW}\rule{\RW}{2\baselineskip}
318 \renewcommand{\DOTIS}[1]{%
319 \setlength{\py}{\fboxrule}
320 \setlength{\fboxrule}{\RW}
321 \setlength{\mylen}{\textwidth}
322 \addtolength{\mylen}{-
2\RW}
323 \fbox{\parbox{\mylen}{\vskip
324 2\baselineskip\CTV\FmTi{#1}\par\nobreak\vskip \baselineskip}}
325 \setlength{\fboxrule}{\py}
333 \DeclareOption{Bjarne
}{%
336 \ChNameVar{\raggedleft\normalsize\rm}
337 \ChNumVar{\raggedleft \bfseries\Large}
338 \ChTitleVar{\raggedleft \Large\rm}
342 %% Note thechapter -> c@chapter fix appendix bug
344 \newcounter{AlphaCnt
}
345 \newcounter{AlphaDecCnt
}
346 \newcommand{\AlphaNo}{%
347 \ifcase\number\theAlphaCnt
350 \or ONE
\or TWO
\or THREE
\or FOUR
\or FIVE
351 \or SIX
\or SEVEN
\or EIGHT
\or NINE
\or TEN
352 \or ELEVEN
\or TWELVE
\or THIRTEEN
\or FOURTEEN
\or FIFTEEN
353 \or SIXTEEN
\or SEVENTEEN
\or EIGHTEEN
\or NINETEEN
\fi
356 \newcommand{\AlphaDecNo}{%
357 \setcounter{AlphaDecCnt
}{0}
358 \@whilenum
\number\theAlphaCnt>
0\do
359 {\addtocounter{AlphaCnt
}{-
10}
360 \addtocounter{AlphaDecCnt
}{1}}
361 \ifnum\number\theAlphaCnt=
0
363 \addtocounter{AlphaDecCnt
}{-
1}
364 \addtocounter{AlphaCnt
}{10}
368 \ifcase\number\theAlphaDecCnt\or TEN
\or TWENTY
\or THIRTY
\or
369 FORTY
\or FIFTY
\or SIXTY
\or SEVENTY
\or EIGHTY
\or NINETY
\fi
371 \newcommand{\TheAlphaChapter}{%
376 \setcounter{AlphaCnt
}{\c@chapter
}
384 \renewcommand{\DOCH}{%
385 \mghrulefill{\RW}\par\nobreak
386 \CNV\FmN{\@chapapp
}\par\nobreak
387 \CNoV\TheAlphaChapter\par\nobreak
388 \vskip -
1\baselineskip\vskip 5pt
\mghrulefill{\RW}\par\nobreak
391 \renewcommand{\DOTI}[1]{%
392 \CTV\FmTi{#1}\par\nobreak
395 \renewcommand{\DOTIS}[1]{%
396 \CTV\FmTi{#1}\par\nobreak
402 \PackageWarning{fancychapter
}{unknown style option
}
405 \ProcessOptions*
\relax
407 \def\@makechapterhead
#1{%
409 {\parindent \z@
\raggedright \normalfont
410 \ifnum \c@secnumdepth >
\m@ne
416 \def\@schapter
#1{\if@twocolumn
417 \@topnewpage
[\@makeschapterhead
{#1}]%
419 \@makeschapterhead
{#1}%
422 \def\@makeschapterhead
#1{%
424 {\parindent \z@
\raggedright