/[escript]/trunk/doc/user/fncychap.sty
ViewVC logotype

Contents of /trunk/doc/user/fncychap.sty

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (18 years, 4 months ago) by jgs
Original Path: trunk/esys2/doc/user/fncychap.sty
File size: 10367 byte(s)
Initial revision

1 % $Id$
2
3 %%% Derived from the original fncychap.sty,
4 %%% but changed ``TWELV'' to ``TWELVE''.
5
6 %%% Copyright Ulf A. Lindgren
7 %%% Department of Applied Electronics
8 %%% Chalmers University of Technology
9 %%% S-412 96 Gothenburg, Sweden
10 %%% E-mail lindgren@ae.chalmers.se
11 %%%
12 %%% Note Permission is granted to modify this file under
13 %%% the condition that it is saved using another
14 %%% file and package name.
15 %%%
16 %%% Revision 1.1
17 %%%
18 %%% Jan. 8th Modified package name base date option
19 %%% Jan. 22th Modified FmN and FmTi for error in book.cls
20 %%% \MakeUppercase{#}->{\MakeUppercase#}
21 %%% Apr. 6th Modified Lenny option to prevent undesired
22 %%% skip of line.
23 %%% Nov. 8th Fixed \@chapapp for AMS
24 %%% Feb. 11th Fixed appendix problem related to Bjarne
25 %%% Last modified Feb. 11th 1998
26
27 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
28 \ProvidesPackage{fncychap}
29 [1997/04/06 v1.11
30 LaTeX package (Revised chapters)]
31
32 %%%% DEFINITION OF Chapapp variables
33 \newcommand{\CNV}{\huge\bfseries}
34 \newcommand{\ChNameVar}[1]{\renewcommand{\CNV}{#1}}
35
36
37 %%%% DEFINITION OF TheChapter variables
38 \newcommand{\CNoV}{\huge\bfseries}
39 \newcommand{\ChNumVar}[1]{\renewcommand{\CNoV}{#1}}
40
41 \newif\ifUCN
42 \UCNfalse
43 \newif\ifLCN
44 \LCNfalse
45 \def\ChNameLowerCase{\LCNtrue\UCNfalse}
46 \def\ChNameUpperCase{\UCNtrue\LCNfalse}
47 \def\ChNameAsIs{\UCNfalse\LCNfalse}
48
49 %%%%% Fix for AMSBook 971008
50
51 \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}
52
53
54 %%%%% Fix for Bjarne and appendix 980211
55
56 \newif\ifinapp
57 \inappfalse
58 \renewcommand\appendix{\par
59 \setcounter{chapter}{0}%
60 \setcounter{section}{0}%
61 \inapptrue%
62 \renewcommand\@chapapp{\appendixname}%
63 \renewcommand\thechapter{\@Alph\c@chapter}}
64
65 %%%%%
66
67 \newcommand{\FmN}[1]{%
68 \ifUCN
69 {\MakeUppercase#1}\LCNfalse
70 \else
71 \ifLCN
72 {\MakeLowercase#1}\UCNfalse
73 \else #1
74 \fi
75 \fi}
76
77
78 %%%% DEFINITION OF Title variables
79 \newcommand{\CTV}{\Huge\bfseries}
80 \newcommand{\ChTitleVar}[1]{\renewcommand{\CTV}{#1}}
81
82 %%%% DEFINITION OF the basic rule width
83 \newlength{\RW}
84 \setlength{\RW}{1pt}
85 \newcommand{\ChRuleWidth}[1]{\setlength{\RW}{#1}}
86
87 \newif\ifUCT
88 \UCTfalse
89 \newif\ifLCT
90 \LCTfalse
91 \def\ChTitleLowerCase{\LCTtrue\UCTfalse}
92 \def\ChTitleUpperCase{\UCTtrue\LCTfalse}
93 \def\ChTitleAsIs{\UCTfalse\LCTfalse}
94 \newcommand{\FmTi}[1]{%
95 \ifUCT
96
97 {\MakeUppercase#1}\LCTfalse
98 \else
99 \ifLCT
100 {\MakeLowercase#1}\UCTfalse
101 \else #1
102 \fi
103 \fi}
104
105
106
107 \newlength{\mylen}
108 \newlength{\myhi}
109 \newlength{\px}
110 \newlength{\py}
111 \newlength{\pyy}
112 \newlength{\pxx}
113
114
115 \def\mghrulefill#1{\leavevmode\leaders\hrule\@height #1\hfill\kern\z@}
116
117 \newcommand{\DOCH}{%
118 \CNV\FmN{\@chapapp}\space \CNoV\thechapter
119 \par\nobreak
120 \vskip 20\p@
121 }
122 \newcommand{\DOTI}[1]{%
123 \CTV\FmTi{#1}\par\nobreak
124 \vskip 40\p@
125 }
126 \newcommand{\DOTIS}[1]{%
127 \CTV\FmTi{#1}\par\nobreak
128 \vskip 40\p@
129 }
130
131 %%%%%% SONNY DEF
132
133 \DeclareOption{Sonny}{%
134 \ChNameVar{\Large\sf}
135 \ChNumVar{\Huge}
136 \ChTitleVar{\Large\sf}
137 \ChRuleWidth{0.5pt}
138 \ChNameUpperCase
139 \renewcommand{\DOCH}{%
140 \raggedleft
141 \CNV\FmN{\@chapapp}\space \CNoV\thechapter
142 \par\nobreak
143 \vskip 40\p@}
144 \renewcommand{\DOTI}[1]{%
145 \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
146 \vskip 5\p@
147 \CTV\FmTi{#1}\par\nobreak
148 \mghrulefill{\RW}\par\nobreak
149 \vskip 40\p@}
150 \renewcommand{\DOTIS}[1]{%
151 \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
152 \vskip 5\p@
153 \CTV\FmTi{#1}\par\nobreak
154 \mghrulefill{\RW}\par\nobreak
155 \vskip 40\p@}
156 }
157
158 %%%%%% LENNY DEF
159
160 \DeclareOption{Lenny}{%
161
162 \ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont}
163 \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont}
164 \ChTitleVar{\Huge\bfseries\rm}
165 \ChRuleWidth{1pt}
166 \renewcommand{\DOCH}{%
167 \settowidth{\px}{\CNV\FmN{\@chapapp}}
168 \addtolength{\px}{2pt}
169 \settoheight{\py}{\CNV\FmN{\@chapapp}}
170 \addtolength{\py}{1pt}
171
172 \settowidth{\mylen}{\CNV\FmN{\@chapapp}\space\CNoV\thechapter}
173 \addtolength{\mylen}{1pt}
174 \settowidth{\pxx}{\CNoV\thechapter}
175 \addtolength{\pxx}{-1pt}
176
177 \settoheight{\pyy}{\CNoV\thechapter}
178 \addtolength{\pyy}{-2pt}
179 \setlength{\myhi}{\pyy}
180 \addtolength{\myhi}{-1\py}
181 \par
182 \parbox[b]{\textwidth}{%
183 \rule[\py]{\RW}{\myhi}%
184 \hskip -\RW%
185 \rule[\pyy]{\px}{\RW}%
186 \hskip -\px%
187 \raggedright%
188 \CNV\FmN{\@chapapp}\space\CNoV\thechapter%
189 \hskip1pt%
190 \mghrulefill{\RW}%
191 \rule{\RW}{\pyy}\par\nobreak%
192 \vskip -\baselineskip%
193 \vskip -\pyy%
194 \hskip \mylen%
195 \mghrulefill{\RW}\par\nobreak%
196 \vskip \pyy}%
197 \vskip 20\p@}
198
199
200 \renewcommand{\DOTI}[1]{%
201 \raggedright
202 \CTV\FmTi{#1}\par\nobreak
203 \vskip 40\p@}
204
205 \renewcommand{\DOTIS}[1]{%
206 \raggedright
207 \CTV\FmTi{#1}\par\nobreak
208 \vskip 40\p@}
209 }
210
211
212 %%%%%%% GLENN DEF
213
214
215 \DeclareOption{Glenn}{%
216 \ChNameVar{\bfseries\Large\sf}
217 \ChNumVar{\Huge}
218 \ChTitleVar{\bfseries\Large\rm}
219 \ChRuleWidth{1pt}
220 \ChNameUpperCase
221 \ChTitleUpperCase
222 \renewcommand{\DOCH}{%
223 \settoheight{\myhi}{\CTV\FmTi{Test}}
224 \setlength{\py}{\baselineskip}
225 \addtolength{\py}{\RW}
226 \addtolength{\py}{\myhi}
227 \setlength{\pyy}{\py}
228 \addtolength{\pyy}{-1\RW}
229
230 \raggedright
231 \CNV\FmN{\@chapapp}\space\CNoV\thechapter
232 \hskip 3pt\mghrulefill{\RW}\rule[-1\pyy]{2\RW}{\py}\par\nobreak}
233
234 \renewcommand{\DOTI}[1]{%
235 \addtolength{\pyy}{-4pt}
236 \settoheight{\myhi}{\CTV\FmTi{#1}}
237 \addtolength{\myhi}{\py}
238 \addtolength{\myhi}{-1\RW}
239 \vskip -1\pyy
240 \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt
241 \raggedleft\CTV\FmTi{#1}\par\nobreak
242 \vskip 80\p@}
243
244 \renewcommand{\DOTIS}[1]{%
245 \setlength{\py}{10pt}
246 \setlength{\pyy}{\py}
247 \addtolength{\pyy}{\RW}
248 \setlength{\myhi}{\baselineskip}
249 \addtolength{\myhi}{\pyy}
250 \mghrulefill{\RW}\rule[-1\py]{2\RW}{\pyy}\par\nobreak
251 % \addtolength{}{}
252 \vskip -1\baselineskip
253 \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt
254 \raggedleft\CTV\FmTi{#1}\par\nobreak
255 \vskip 60\p@}
256 }
257
258 %%%%%%% CONNY DEF
259
260 \DeclareOption{Conny}{%
261 \ChNameUpperCase
262 \ChTitleUpperCase
263 \ChNameVar{\centering\Huge\rm\bfseries}
264 \ChNumVar{\Huge}
265 \ChTitleVar{\centering\Huge\rm}
266 \ChRuleWidth{2pt}
267
268 \renewcommand{\DOCH}{%
269 \mghrulefill{3\RW}\par\nobreak
270 \vskip -0.5\baselineskip
271 \mghrulefill{\RW}\par\nobreak
272 \CNV\FmN{\@chapapp}\space \CNoV\thechapter
273 \par\nobreak
274 \vskip -0.5\baselineskip
275 }
276 \renewcommand{\DOTI}[1]{%
277 \mghrulefill{\RW}\par\nobreak
278 \CTV\FmTi{#1}\par\nobreak
279 \vskip 60\p@
280 }
281 \renewcommand{\DOTIS}[1]{%
282 \mghrulefill{\RW}\par\nobreak
283 \CTV\FmTi{#1}\par\nobreak
284 \vskip 60\p@
285 }
286 }
287
288 %%%%%%% REJNE DEF
289
290 \DeclareOption{Rejne}{%
291
292 \ChNameUpperCase
293 \ChTitleUpperCase
294 \ChNameVar{\centering\Large\rm}
295 \ChNumVar{\Huge}
296 \ChTitleVar{\centering\Huge\rm}
297 \ChRuleWidth{1pt}
298 \renewcommand{\DOCH}{%
299 \settoheight{\py}{\CNoV\thechapter}
300 \addtolength{\py}{-1pt}
301 \CNV\FmN{\@chapapp}\par\nobreak
302 \vskip 20\p@
303 \setlength{\myhi}{2\baselineskip}
304 \setlength{\px}{\myhi}
305 \addtolength{\px}{-1\RW}
306 \rule[-1\px]{\RW}{\myhi}\mghrulefill{\RW}\hskip
307 10pt\raisebox{-0.5\py}{\CNoV\thechapter}\hskip
308 10pt\mghrulefill{\RW}\rule[-1\px]{\RW}{\myhi}\par\nobreak
309 \vskip -1\p@
310 }
311 \renewcommand{\DOTI}[1]{%
312 \setlength{\mylen}{\textwidth}
313 \addtolength{\mylen}{-2\RW}
314 {\vrule width\RW}\parbox{\mylen}{\CTV\FmTi{#1}}{\vrule
315 width\RW}\par\nobreak
316 \vskip
317 -1pt\rule{\RW}{2\baselineskip}\mghrulefill{\RW}\rule{\RW}{2\baselineskip}
318 \vskip 60\p@
319 }
320 \renewcommand{\DOTIS}[1]{%
321 \setlength{\py}{\fboxrule}
322 \setlength{\fboxrule}{\RW}
323 \setlength{\mylen}{\textwidth}
324 \addtolength{\mylen}{-2\RW}
325 \fbox{\parbox{\mylen}{\vskip
326 2\baselineskip\CTV\FmTi{#1}\par\nobreak\vskip \baselineskip}}
327 \setlength{\fboxrule}{\py}
328 \vskip 60\p@
329 }
330 }
331
332
333 %%%%%%% BJARNE DEF
334
335 \DeclareOption{Bjarne}{%
336 \ChNameUpperCase
337 \ChTitleUpperCase
338 \ChNameVar{\raggedleft\normalsize\rm}
339 \ChNumVar{\raggedleft \bfseries\Large}
340 \ChTitleVar{\raggedleft \Large\rm}
341 \ChRuleWidth{1pt}
342
343
344 %% Note thechapter -> c@chapter fix appendix bug
345
346 \newcounter{AlphaCnt}
347 \newcounter{AlphaDecCnt}
348 \newcommand{\AlphaNo}{%
349 \ifcase\number\theAlphaCnt
350 \ifnum\c@chapter=0
351 ZERO\else{}\fi
352 \or ONE\or TWO\or THREE\or FOUR\or FIVE
353 \or SIX\or SEVEN\or EIGHT\or NINE\or TEN
354 \or ELEVEN\or TWELVE\or THIRTEEN\or FOURTEEN\or FIFTEEN
355 \or SIXTEEN\or SEVENTEEN\or EIGHTEEN\or NINETEEN\fi
356 }
357
358 \newcommand{\AlphaDecNo}{%
359 \setcounter{AlphaDecCnt}{0}
360 \@whilenum\number\theAlphaCnt>0\do
361 {\addtocounter{AlphaCnt}{-10}
362 \addtocounter{AlphaDecCnt}{1}}
363 \ifnum\number\theAlphaCnt=0
364 \else
365 \addtocounter{AlphaDecCnt}{-1}
366 \addtocounter{AlphaCnt}{10}
367 \fi
368
369
370 \ifcase\number\theAlphaDecCnt\or TEN\or TWENTY\or THIRTY\or
371 FORTY\or FIFTY\or SIXTY\or SEVENTY\or EIGHTY\or NINETY\fi
372 }
373 \newcommand{\TheAlphaChapter}{%
374
375 \ifinapp
376 \thechapter
377 \else
378 \setcounter{AlphaCnt}{\c@chapter}
379 \ifnum\c@chapter<20
380 \AlphaNo
381 \else
382 \AlphaDecNo\AlphaNo
383 \fi
384 \fi
385 }
386 \renewcommand{\DOCH}{%
387 \mghrulefill{\RW}\par\nobreak
388 \CNV\FmN{\@chapapp}\par\nobreak
389 \CNoV\TheAlphaChapter\par\nobreak
390 \vskip -1\baselineskip\vskip 5pt\mghrulefill{\RW}\par\nobreak
391 \vskip 20\p@
392 }
393 \renewcommand{\DOTI}[1]{%
394 \CTV\FmTi{#1}\par\nobreak
395 \vskip 40\p@
396 }
397 \renewcommand{\DOTIS}[1]{%
398 \CTV\FmTi{#1}\par\nobreak
399 \vskip 40\p@
400 }
401 }
402
403 \DeclareOption*{%
404 \PackageWarning{fancychapter}{unknown style option}
405 }
406
407 \ProcessOptions* \relax
408
409 \def\@makechapterhead#1{%
410 \vspace*{50\p@}%
411 {\parindent \z@ \raggedright \normalfont
412 \ifnum \c@secnumdepth >\m@ne
413 \DOCH
414 \fi
415 \interlinepenalty\@M
416 \DOTI{#1}
417 }}
418 \def\@schapter#1{\if@twocolumn
419 \@topnewpage[\@makeschapterhead{#1}]%
420 \else
421 \@makeschapterhead{#1}%
422 \@afterheading
423 \fi}
424 \def\@makeschapterhead#1{%
425 \vspace*{50\p@}%
426 {\parindent \z@ \raggedright
427 \normalfont
428 \interlinepenalty\@M
429 \DOTIS{#1}
430 \vskip 40\p@
431 }}
432
433 \endinput
434
435

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26