Debian Codegraph @

texmf-dist/doc/latex/fncychap/fncychap.tex

raw
1 %% Copyright 2007 Ulf Lindgren
2 %
3 % This work may be distributed and/or modified under the conditions of the LaTeX
4 % Project Public License, either version 1.3 of this license or (at your option)
5 % any later version. The latest version of this license is in
6 % http://www.latex-project.org/lppl.txt
7 % and version 1.3 or later is part of all distributions of LaTeX version
8 % 2005/12/01 or later.
9 %
10 % This work has the LPPL maintenance status `maintained'.
11 %
12 % The Current Maintainer of this work is Ulf Lindgren.
13 %
14 % This work consists of all files listed in manifest.txt.
15 %
16 %% This statement added 2010/12/10 by Clea F. Rees following correspondence
17 %% between Ulf Lindgren and Karl Berry concerning licensing.
18
19 \documentclass{report}
20
21 \setlength{\textheight}{23 cm}
22 \setlength{\voffset}{-0.54cm}
23 \setlength{\hoffset}{-0.54cm}
24 \setlength{\oddsidemargin}{0.5 cm}
25 \setlength{\evensidemargin}{0.5 cm}
26 \setlength{\textwidth}{16 cm}
27 \setlength{\marginparwidth}{2.5 cm}
28 \setlength{\topmargin}{0.5 cm}
29 \setlength{\headheight}{0.5 cm}
30 \setlength{\headsep}{0.5 cm}
31
32 % \setlength{\voffset}{-5cm}
33 \usepackage[T1]{fontenc}
34 \usepackage{graphicx}
35 \usepackage[Lenny]{fncychap}
36 \usepackage{ydrop}
37 \newcommand{\sk}{\vspace{0.2 cm}}
38 \newcommand{\A}[1]{{$\backslash${\tt #1}}}
39 \newcommand{\nsp}{\mbox{\hspace{-1 cm}}}
40 \title{FncyChap V1.34}
41 \author{Ulf A. Lindgren}
42 \date{}
43
44 \begin{document}
45 \maketitle
46 \tableofcontents
47 \setlength{\dropcapsheight}{24pt}
48 \chapter{Package description}
49 \drop{T}he package \textsl{fncychap} has been written such that
50 chapter level headings can be altered fast and for me to learn more
51 about \LaTeX{} and \TeX{}. I have no idea if this package is
52 written in a good way. Thus, if anyone reads and tries {\em
53 FncyChap} I would appreciate any feedback. This will help me gain
54 insight in writing macros.
55
56 In any publication it is important to remember that consistency
57 plays an important role. That is, with this package one can change
58 the appearance of each chapter in the publication. However, this is
59 not desirable so don't forget modesty and consistency.
60
61 \section{Basic use and requirements}
62 The package is invoked by writing the following in the preamble of
63 your document\sk\\
64 \nsp\fbox{\A{usepackage}[{\em style}]\{{\em fncychap}\}}\sk\\
65 If the option, {\em style}, is omitted then the default definition
66 of chapter is used. Originally, there were six predefined chapter styles,
67 namely {\em Sonny, Lenny, Glenn, Conny, Rejne} and {\em Bjarne}.
68 The names corresponds to Swedish given names, almost surely (a.s.)
69 like
70 IKEA\footnote{reg. trademark of Ingvar Kamprad Emtaryd
71 Agunnaryd}. Each such style has a default configuration and if
72 that configuration is sufficient, then this is all that is needed.
73
74 In the present release of \textsl{fncychap} two additional chapter
75 definitions have been included. The first of these is named {\em
76 PetersLenny}, after the author Peter Osborn. This chapter
77 definition is based on {\em Lenny}, Peter has carefully tweaked
78 the measures of the lines, individually, for each chapter number (up to 20)
79 and each appendix (up to Z). The second chapter head is a new one
80 defined by Jean-Marc Francois and he named it \textsl{Bjornstrup}.
81
82 Originally, \textsl{fncychap} did not rely on any other package. However, for the
83 style {\tt Lenny} a postscript font is default, but this font can
84 easily be changed. I encourage the use of the default postscript
85 font since it is scalable in a truly huge manner, which makes
86 {\em Lenny} nice. In the current release and with the use of
87 Jean-Marcs \textsl{Bjornstrup} the color package from the base
88 distribution will be invoked.
89
90 \chapter{Commands provided}
91 \drop{A} part from the chapter styles, some additional commands are
92 provided in order to create user defined chapter heads. The commands
93 will in the sequel be described. Each command is boxed and placed on
94 a separate line. Lets begin the descriptions of the commands.\sk\\
95 \nsp\fbox{\A{mghrulefill}\{{\em width}\}}\sk\\
96 The above command is a more general version of the command
97 \A{hrulefill} in the sense that the width of the ruler can be
98 specified. This command is provided in order to decorate the chapter
99 headers. The chapter heading are divided into two parts. The first
100 part defines the so called \A{chapapp} and \A{thechapter} which
101 holds information of the text ``Chapter'' and the current chapter number
102 respectively. The second part is the chapter title provided by the
103 user. From now one, the \A{chapapp} and \A{thechapter} will be
104 referred to as chapter name and chapter number respectively. The
105 user defined title is referred to as the chapter title.
106
107 \section{Toward customization of the chapter head}
108 \label{sec:TW}
109 The chapter name, number and title can be changed easy, first lets
110 introduce the following two commands\sk\\
111 \nsp\fbox{\A{ChNameUpperCase}}\sk\\
112 and\sk\\
113 \nsp\fbox{\A{ChNameLowerCase}}\sk\\
114 these commands will change the chapter name into either upper or
115 lower case. One additional case command is provided for the
116 chapter name, namely\sk\\
117 \nsp\fbox{\A{ChNameAsIs}}\sk\\
118 which result in the default case. Three similar commands for the
119 chapter title are defined by the commands\sk\\
120 \nsp\fbox{\A{ChTitleUpperCase}, \A{ChTitleLowerCase} and
121 \A{ChNameAsIs}}\sk\\
122 The rule width of the predefined chapter styles can be controlled
123 by the command\sk\\
124 \nsp\fbox{\A{ChRuleWidth}\{{\em width}\}}\sk\\
125 just remember that the {\em width} must have a unit, for instance
126 {\em pt, mm, etc}. The font related matters such as size, type and
127 face can be sent using the commands\sk\\
128 \nsp\fbox{\A{ChNameVar}\{{\em stuff}\}, \A{ChNumVar}\{{\em stuff}\} and
129 \A{ChTitleVar}\{{\em stuff}\}}\sk\\
130 related to the chapter name number and title respectively.
131 The argument, {\em stuff}, to these functions can be for example
132 \mbox{\A{ChNameVar}\{\A{huge}\A{rm}\A{centering}\}}.
133 \enlargethispage{1cm}
134 \chapter{An overview of the chapter styles}
135 \setlength{\dropcapsheight}{28pt}
136 \drop{T}he chapter styles have default settings for all of the functions
137 described in section~\ref{sec:TW}. However, it can be changed
138 using the commands. Note that if \A{centering}, etc is used to
139 format the text part of the chapter style then the result can be
140 ugly. The chapter style {\em Bjarne} contains one additional
141 command\sk\\
142 \nsp\fbox{\A{TheAlphaChapter}}\sk\\
143 This command will write the chapter number using the corresponding
144 word. \A{TheAlphaChapter} have a capability of writing the words
145 {\em ZERO} to {NINETYNINE}.
146
147
148 In the following sections the pre-defined styles are shown along
149 with the default settings. Both the \A{chapter} and \A{chapter*}
150 are given.
151 \section{The chapter Sonny}
152 The following settings have been used as default parameters
153 {\small\begin{verbatim}
154 \ChNameVar{\Large\sf} \ChNumVar{\Huge} \ChTitleVar{\Large\sf}
155 \ChRuleWidth{0.5pt} \ChNameUpperCase
156 \end{verbatim}}
157 \begin{figure}[h]
158 \begin{minipage}{7 cm}
159 \label{fig:Sonnys}
160 \centerline{\includegraphics[height=6cm]{Sonnys.eps}}
161 \caption{The stared chapter style sonny}
162 \end{minipage}\hfill
163 \begin{minipage}{7 cm}
164 \label{fig:Sonny}
165 \centerline{\includegraphics[height=6cm]{Sonny.eps}}
166 \caption{The chapter style Sonny}
167 \end{minipage}\hfill
168 \end{figure}
169
170 % \clearpage
171 \section{The chapter Lenny}
172 The following settings have been used as default parameters
173 {\small\begin{verbatim}
174 \ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont}
175 \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont}
176 \ChTitleVar{\Huge\bfseries\rm}, \ChRuleWidth{1pt}
177 \end{verbatim}}
178 \begin{figure}[h]
179 \begin{minipage}{7 cm}
180 \centerline{\includegraphics[height=6cm]{Lennys.eps}}
181 \caption{The stared chapter style Lenny}
182 \end{minipage}\hfill
183 \begin{minipage}{7 cm}
184 \centerline{\includegraphics[height=6cm]{Lenny.eps}}
185 \caption{The chapter style Lenny}
186 \end{minipage}\hfill
187 \end{figure}
188 \textbf{Note:} An alternative version of this chapter head exist
189 entitled \textsl{PetersLenny}.
190 %\enlargethispage{2cm}
191
192 \section{The chapter Glenn}
193 The following settings have been used as default parameters
194 {\small\begin{verbatim}
195 \ChNameVar{\bfseries\Large\sf}, \ChNumVar{\Huge}, \ChTitleVar{\bfseries\Large\rm},
196 \ChRuleWidth{1pt}, \ChNameUpperCase, \ChTitleUpperCase
197 \end{verbatim}}
198 \begin{figure}[h]
199 \begin{minipage}{7 cm}
200 \centerline{\includegraphics[height=6cm]{Glenns.eps}}
201 \caption{The stared chapter style Glenn}
202 \end{minipage}\hfill
203 \begin{minipage}{7 cm}
204 \centerline{\includegraphics[height=6cm]{Glenn.eps}}
205 \caption{The chapter style Glenn}
206 \end{minipage}\hfill
207 \end{figure}
208
209 \section{The chapter Conny}
210 The following settings have been used as default parameters
211 {\small\begin{verbatim}
212 \ChNameUpperCase \ChTitleUpperCase \ChNameVar{\centering\Huge\rm\bfseries}
213 \ChNumVar{\Huge} \ChRuleWidth{2pt} \ChTitleVar{\centering\Huge\rm}
214 \end{verbatim}}
215 \begin{figure}[h]
216 \begin{minipage}{7 cm}
217 \centerline{\includegraphics[height=6cm]{Connys.eps}}
218 \caption{The stared chapter style Conny}
219 \end{minipage}\hfill
220 \begin{minipage}{7 cm}
221 \centerline{\includegraphics[height=6cm]{Conny.eps}}
222 \caption{The chapter style Conny}
223 \end{minipage}\hfill
224 \end{figure}
225
226 \section{The chapter Rejne}
227 The following settings have been used as default parameters\\
228 {\small\begin{verbatim}
229 \ChNameVar{\centering\Huge\rm\bfseries}, \ChNumVar{\Huge}, \ChTitleVar{\centering\Huge\rm}
230 \ChNameUpperCase, \ChTitleUpperCase, \ChRuleWidth{1pt}
231 \end{verbatim}}
232 \begin{figure}[h]
233 \begin{minipage}{7 cm}
234 \centerline{\includegraphics[height=6cm]{Rejnes.eps}}
235 \caption{The stared chapter style Rejne}
236 \end{minipage}\hfill
237 \begin{minipage}{7 cm}
238 \centerline{\includegraphics[height=6cm]{Rejne.eps}}
239 \caption{The chapter style Rejne}
240 \end{minipage}\hfill
241 \end{figure}
242 \section{The chapter Bjarne}
243 The following settings have been used as default parameters\\
244 {\small\begin{verbatim}
245 \ChNameUpperCase \ChNameVar{\raggedleft\normalsize\rm} \ChRuleWidth{1pt}
246 \ChTitleUpperCase \ChNumVar{\raggedleft \bfseries\Large} \ChTitleVar{\raggedleft \Large\rm}
247 \end{verbatim}}
248 \begin{figure}[h]
249 \begin{minipage}{7 cm}
250 \centerline{\includegraphics[height=6cm]{Bjarnes.eps}}
251 \caption{The stared chapter style Bjarne}
252 \end{minipage}\hfill
253 \begin{minipage}{7 cm}
254 \centerline{\includegraphics[height=6cm]{Bjarne.eps}}
255 \caption{The chapter style Bjarne}
256 \end{minipage}\hfill
257 \end{figure}
258
259 \section{The chapter Bjornstrup}
260 The following settings have been used as default parameters\\
261 {\small\begin{verbatim}
262 \ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont}
263 \ChTitleVar{\raggedleft\Large\sffamily\bfseries}
264
265 \end{verbatim}}
266 \begin{figure}[h]
267 \begin{minipage}{7 cm}
268 \centerline{\includegraphics[height=6cm]{BjornstrupS.eps}}
269 \caption{The stared chapter style Bjornstrup}
270 \end{minipage}\hfill
271 \begin{minipage}{7 cm}
272 \centerline{\includegraphics[height=6cm]{Bjornstrup.eps}}
273 \caption{The chapter style Bjornstrup}
274 \end{minipage}\hfill
275 \end{figure}
276 \textbf{Note:} It appears as if the rendering in YAP (dvi previewer in
277 MikTeX) differs from dvips in that the gray box become
278 foreground. Thus, the chapter number is partly hidden.
279 \enlargethispage{2cm}
280 \chapter{A simple example}
281 \drop{I}f the pre defined styles does not fulfill your needs then you can
282 modify the formating routines. The formatting is controlled by
283 three commands. One might as well redefine the original
284 chapter definitions using the \A{secdef} and \A{renewcommand}, see
285 The \LaTeX{} companion. However, at the time of creating this
286 package I decided that this was easier. The command\sk\\
287 \nsp\fbox{\A{DOCH}}\sk\\
288 formats the chapter name and number. The commands\sk\\
289 \nsp\fbox{\A{DOTI}\{{\#1}\}}\sk\\
290 and\sk\\
291 \nsp\fbox{\A{DOTIS}\{{\#1}\}}\sk\\
292 formats the chapter title for \A{chapter} and \A{chapter*} respectively.
293 In order to modify these you will have to use the preamble along
294 with the commands \A{makeatletter} and \A{makeatother}. The in
295 addition some predefined parameters can be used. The predefined
296 length variables are\sk\\
297 \nsp\fbox{\A{mylen}, \A{myhi}, \A{px}, \A{py}, \A{pxx}, \A{pyy}
298 and \A{RW}}\sk\\
299 note that \A{RW} is special, since it is set by \A{ChRuleWidth}.
300 The formatting controlled by \A{ChNameVar}, \A{ChNumVar} and
301 \A{ChTitleVar} store their values in \A{CNV}, \A{CNoV} and \A{CTV}
302 respectively. Finally, The functions \A{FmN}\{ \} and \A{FmTi}\{
303 \} acts accordingly to \A{Ch***AsIs}, \A{Ch***UpperCase} and
304 \A{Ch***LowerCase}. Note that the stars indicate appropriate
305 substitution of text, see section~\ref{sec:TW}.
306
307 To illustrate this lets define a new chapter style in which the
308 Chapter name and number in a \A{fbox} and the chapter title
309 centered. The \A{fboxrule} is linked to the predefined length
310 \A{RW} so that it can be controlled by the command
311 \A{ChRuleWidth}. Try this example at a computer near you.
312 \begin{verbatim}
313 \makeatletter
314 \ChNameVar{\Large\rm} % sets the style for name
315 \ChNumVar{\Huge} % sets the style for digit
316 \ChTitleVar{\Large\rm\centering} % sets the style for title
317 \ChRuleWidth{4pt} % Set RW=4pt
318 \ChNameUpperCase % Make name uppercase
319 \renewcommand{\DOCH}{%
320 \setlength{\fboxrule}{\RW} % Let fbox lines be controlled by
321 % \ChRuleWidth
322
323 \fbox{\CNV\FmN{\@chapapp}\space \CNoV\thechapter}\par\nobreak
324 \vskip 40\p@}
325
326 \renewcommand{\DOTI}[1]{%
327 \CTV\FmTi{#1}\par\nobreak
328 \vskip 40\p@}
329 \renewcommand{\DOTIS}[1]{%
330 \CTV\FmTi{#1}\par\nobreak
331 \vskip 40\p@}
332 \makeatother
333 \end{verbatim}
334 That is all there is to it. Note that the commands \A{DOTI} and
335 \A{DOTIS} can be redefined anywhere in the document, but that is
336 not a good idea. Suppose that you want to use the
337 \A{TheAlphaChapter}. This can be done by initially chose the style
338 {\em Bjarne}\/ and then redefine \A{DOCH}, \A{DOTI} and \A{DOTIS}.
339 \chapter{Revision details}
340
341 \drop{T}his is version 1.34, some minor problems have been
342 addressed and two new predefined chapter heads have been
343 incorporated. The upper case and lower case handling have been
344 corrected. A bad behavior in changes between \verb+\frontmatter+,
345 \verb+\mainmatter+ and \verb+\backmatter+, have been fixed.
346
347 In version 1.33 Rejne definition streched text caused ugly gaps
348 in the vrule aligned with the title text. A compatibility problem
349 with the KOMA class 'scrbook.cls' the remedy is a redefinition of
350 '\@schapter' in line with that used in KOMA. This might not be
351 good since it differs from the base definition. A spell error was
352 corrected.
353
354 In version 1.3, a problem with appendices in the Bjarne style was
355 corrected. Wrong behavior, for the commands
356 \verb+\frontmatter+, \verb+\mainmatter+ and \verb+\backmatter+
357 was dealt with.
358
359 In the release 1.11 of the current package. A bug
360 fix of the Lenny option was included. The problem, reported
361 by Diab Jerius, occurred (underfull vbox) when the option Lenny
362 was used in conjunction with \A{section}-command such that the
363 section is typeset at the next page. This caused one line to be
364 misplaced. The remedy was to box the chapter title.
365
366 In the release (1.1) of the current package. A
367 modification was made such that it will work with the book
368 class. The problem occurred when the fncychap styles Conny,
369 Rejne, Bjarne or Glenn were used in conjunction with the
370 \LaTeX{} command \A{tabelofcontents}. The exact reason for the
371 error is not yet found. The problem was reported by Olivier Guibe.
372
373 In the prior release there were no major improvements of the
374 package. However, the package name was changed in order to
375 conform with the (DOS) requirement of eight characters. I also
376 received some feedback, informing me that the \LaTeX{} base have
377 to be post 1994/12/01. This information has been included in
378 the package such that if an old base is used a warning will be
379 written into the {\tt
380 log}.\\
381 Release history:
382 \begin{description}
383 \item[Release 1] 1996/12/13 FancyChapters 1.0b
384 \item[Release 2] 1997/01/08 FncyChap 1.0 (Name change, base
385 date option)
386 \item[Release 3] 1997/01/22 FncyChap 1.1 (Bug fix)
387 \item[Release 4] 1997/04/06 FncyChap 1.11 (Bug fix)
388 \item[Release 5] 2004/09/20 FncyChap 1.3 (Bug fix)
389 \item[Release 6] 2005/08/09 FncyChap 1.33 (Bug fix)
390 \item[Release 7] 2007/07/31 FncyChap 1.34 (Bug fix)
391 \end{description}
392
393 \end{document}
394 %%% Local Variables:
395 %%% mode: latex
396 %%% TeX-master: t
397 %%% End:
398
399
400
401
402
403
404
405
406
407
408
409
410
411