source: documentation/user_manual/fncychap.sty @ 2363

Last change on this file since 2363 was 2363, checked in by ole, 19 years ago

Tried to move documentation again

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