You are on page 1of 11

Gi lnh fncychap.

sty iu khin cc tiu chng

Nguyn Hu in Khoa Ton - C - Tin hc HKHTN H Ni, HQGHN

1 M t gi lnh 1.1 Khai bo phn u vn bn . . . . . . . . . . . . . . . . . . . . .

2 2 3 3 4 4 4 5 5 6 6 7 8 10

2 Cc lnh ca gi lnh 2.1 t li tiu chng . . . . . . . . . . . . . . . . . . . . . . . .

3 Mu nh dng chng 3.1 3.2 3.3 3.4 3.5 3.6 3.7 Chng kiu Sonny . . . . . . . . . . . . . . . . . . . . . . . . . . Chng kiu Lenny . . . . . . . . . . . . . . . . . . . . . . . . . . Chng kiu Glenn . . . . . . . . . . . . . . . . . . . . . . . . . . Chng kiu Conny . . . . . . . . . . . . . . . . . . . . . . . . . Chng kiu Rejne . . . . . . . . . . . . . . . . . . . . . . . . . . Chng kiu Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . Chng kiu Bjornstrup . . . . . . . . . . . . . . . . . . . . . . .

4 V d n gin Ti liu tham kho . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
http://www.ctan.org/tex-archive/macros/latex/contrib/fncychap Vi gi lnh ny d dng thay i tiu chng.

M
Tc gi Ulf A. Lindgren cung cp gi lnh iu khin tiu chng ti

1.1 Khai bo phn u vn bn


Ta a gi lnh bng ccha vo u vn bn

\usepackage[style]{fncychap}
Ty chn style: 1. Nu khng c ty chn th nh dang chng bnh thng ch LaTeX. 2. C 6 kiu nh dng chng c nh ngha: Sonny, Lenny, Glenn, Conny, Rejne v Bjarne. 3. C hai dng ca 2 tc gi: PetersLenny ca Peter Osborn v Bjornstrup ca Jean-Marc Francois. Gi lnh tng thch vi mi gi lnh. Nhng kiu Lenny dng phng OT1 nn dng cho ting Vit phi i.

C
Mi chi tit ca chng c th thay i v t li c. C lnh tng qut nh

\mghrulefill{width}
Lnh ny tng qut hn lnh \hrulefill v c rng ca ng k. Mt tiu chng ch lm hai phn s v ni dung \chapapp v \thechapter mc nh l Chapter s chng. Phn th 2 l tn ca chng.

2.1 t li tiu chng


Tn chng, s chng v tiu chng c th dng thay i nh:

\ChNameUpperCase ch Chng hoa; \ChNameLowerCase ch Chng thng; \ChNameAsIs t li Chng thnh tn khc nh "Ch " \ChTitleUpperCase, \ChTitleLowerCase v \ChNameAsIs tc dng nn tiu chng. \ChRuleWidth{width} rng ca ng k nu c. vi width phi c n v pt, mm, etc.
iu khin to nh ca cc thnh phn trn bng:

\ChNameVar{stuff}, \ChNumVar{stuff} v \ChTitleVar{stuff}


i s: stuff l cc lnh c v iu khin nh

\ChNameVar{\huge\rm\centering}.

M
nh dng kiu Bjarne c thm lnh:

\TheAlphaChapter lnh ny c th vit s chng l ch nh t ZERO n NINETYNINE. Mu sau y ng cho c \chapter v \chapter*.

3.1 Chng kiu Sonny


Mc nh kiu ny l
\ChNameVar{\Large\sf} \ChNumVar{\Huge} \ChTitleVar{\Large\sf} \ChRuleWidth{0.5pt} \ChNameUpperCase
CHAPTER 1

Contents

Package description
1 Package description
1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 3.2 3.3 3.4 3.5 3.6 The chapter Sonny . The chapter Lenny . The chapter Glenn . The chapter Conny . The chapter Rejne . The chapter Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3

2 Commands provided

In this chapter a short introduction of the package will be given. The package has been written in order
A for me to learn more about L TEX and TEX. I have no idea if this package is written in a good way. Thus, if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is that it will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so don't forget modesty and consistency.

3 An overview of the chapter styles

5 5 5 6 6 7

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage style]ffancychaptersg

4 An simple example

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if that con guration is su cient, then this is all that is needed. The package does not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Hnh 3.1: Phn mc lc sonny

Hnh 3.2: u chng Sonny

3.2 Chng kiu Lenny


Mc nh kiu ny l 4

http://nhdien.wordpress.com - Nguyn Hu in
\ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont} \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont} \ChTitleVar{\Huge\bfseries\rm}, \ChRuleWidth{1pt}
Contents
Chapter

Package description
1 Package description
1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . The chapter Sonny . The chapter Lenny . The chapter Glenn . The chapter Conny . The chapter Rejne . The chapter Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3

2 Commands provided
3.1 3.2 3.3 3.4 3.5 3.6

3 An overview of the chapter styles

5 6 6 7 7 8

In this chapter a short introduction of the package will be given. The package has been written in order A for me to learn more about L TEX and TEX. I have no idea if this package is written in a good way. Thus, if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is that it will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so don't forget modesty and consistency.

4 An simple example

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if that con guration is su cient, then this is all that is needed. The package does not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Hnh 3.3: Phn mc lc Lenny

Hnh 3.4: u chng Lenny

3.3 Chng kiu Glenn


Mc nh loi ny
\ChNameVar{\bfseries\Large\sf}, \ChNumVar{\Huge}, \ChTitleVar{\bfseries\Large\rm}, \ChRuleWidth{1pt}, \ChNameUpperCase, \ChTitleUpperCase
CONTENTS
CHAPTER 1

PACKAGE DESCRIPTION

1 Package description

1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 3.2 3.3 3.4 3.5 3.6 The chapter Sonny . The chapter Lenny . The chapter Glenn . The chapter Conny . The chapter Rejne . The chapter Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3 5 6 6 7 7 8

In this chapter a short introduction of the package will be given. The package has been written in order
A for me to learn more about L TEX and TEX. I have no idea if this package is written in a good way. Thus, if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is that it will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so don't forget modesty and consistency.

2 Commands provided

3 An overview of the chapter styles

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage style]ffancychaptersg

4 An simple example

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if that con guration is su cient, then this is all that is needed. The package does not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Hnh 3.5: Phn mc lc Glenn

Hnh 3.6: u chng Glenn

3.4 Chng kiu Conny


Mc nh kiu ny l

http://nhdien.wordpress.com - Nguyn Hu in

\ChNameUpperCase \ChTitleUpperCase \ChNameVar{\centering\Huge\rm\bfseries} \ChNumVar{\Huge} \ChRuleWidth{2pt} \ChTitleVar{\centering\Huge\rm}


CONTENTS

PACKAGE DESCRIPTION
1 Package description
1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 3.2 3.3 3.4 3.5 3.6 The chapter Sonny . The chapter Lenny . The chapter Glenn . The chapter Conny . The chapter Rejne . The chapter Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CHAPTER 1

2 Commands provided

3 5 5 5 6 6 7

3 An overview of the chapter styles

if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is that it will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so don't forget modesty and consistency.

In me tochaptermore about LTEX andofTEthe packagenowill beifgiven.package is written beengood way.in Thus, this a short introduction The package has written order for learn X. I have idea this in a
A

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage style]ffancychaptersg

4 An simple example

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if that con guration is su cient, then this is all that is needed. The package does not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Hnh 3.7: Phn mc lc Conny

Hnh 3.8: u chng Conny

3.5 Chng kiu Rejne


Mc nh kiu ny l
\ChNameVar{\centering\Huge\rm\bfseries}, \ChNumVar{\Huge}, \ChTitleVar{\centering\Huge\rm} \ChNameUpperCase, \ChTitleUpperCase, \ChRuleWidth{1pt}
CHAPTER

CONTENTS

1 PACKAGE DESCRIPTION
2

1 Package description

1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . The chapter Sonny . The chapter Lenny . The chapter Glenn . The chapter Conny . The chapter Rejne . The chapter Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3

2 Commands provided
3.1 3.2 3.3 3.4 3.5 3.6

3 An overview of the chapter styles

5 5 6 6 7 7

n this chapter a short introduction of the package will be given. The package has been written in order A for me to learn more about L TEX and TEX. I have no idea if this package is written in a good way. Thus, if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is that it will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage style]ffancychaptersg

4 An simple example

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if that con guration is su cient, then this is all that is needed. The package does not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Hnh 3.9: Phn mc lc Rejne

Hnh 3.10: u chng Rejne

3.6 Chng kiu Bjarne


Mc nh kiu ny l

http://nhdien.wordpress.com - Nguyn Hu in

\ChNameUpperCase \ChNameVar{\raggedleft\normalsize\rm} \ChRuleWidth{1pt} \ChTitleUpperCase \ChNumVar{\raggedleft \bfseries\Large} \ChTitleVar{\raggedleft \Large\rm}


CONTENTS
CHAPTER

ONE

PACKAGE DESCRIPTION
1 Package description
1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 Commands provided
3.1 3.2 3.3 3.4 3.5 3.6

2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . The chapter Sonny . The chapter Lenny . The chapter Glenn . The chapter Conny . The chapter Rejne . The chapter Bjarne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 5

3 5 6 6 7 7 8

3 An overview of the chapter styles

In this chapter a short introduction of the package will be given. The package has been written in order A for me to learn more about L TEX and TEX. I have no idea if this package is written in a good way. Thus, if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is that it will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage style]ffancychaptersg

4 An simple example

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if that con guration is su cient, then this is all that is needed. The package does not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Hnh 3.11: Phn mc lc Bjarne

Hnh 3.12: u chng Bjarne

3.7 Chng kiu Bjornstrup


Mc nh kiu ny l
\ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont} \ChTitleVar{\raggedleft\Large\sffamily\bfseries}

Contents

Package description

1 Package description 1.1 Basic use and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Commands provided 2.1 Toward customization of the chapter head . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 An 3.1 3.2 3.3 3.4 3.5 3.6 overview of The chapter The chapter The chapter The chapter The chapter The chapter the chapter Sonny . . . . Lenny . . . . Glenn . . . . Conny . . . . Rejne . . . . Bjarne . . . . styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 2 3 3 5 5 6 6 7 7 8 9 11

package fncychap level headings and T he learn more about hasEbeen written Isuch that chapterthis package is can be altered fast way. for me to L T X and TEX. have no idea if written in a good Thus,
A

if anyone reads and tries FncyChap I would appreciate any feedback. This will help me gain insight in writing macros. In any publication it is important to remember that consistency plays a important role. That is, with this package one can change the appearance of each chapter in the publication. However, this is not desirable so dont forget modesty and consistency.

1.1

Basic use and requirements

The package is invoked by writing the following in the preamble of your document \usepackage[style]{fncychap} If the option, style, is omitted then the default denition of chapter is used. Originally, there were six predened chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to Swedish given names, almost surely (a.s.) like IKEA1 . Each such style has a default conguration and if that conguration is sucient, then this is all that is needed. In the present release of fncychap two additional chapter denitions have been included. The rst of these is named PetersLenny, after the author Peter Osborn. This chapter denition is based on Lenny, Peter has carefully tweaked the measures of the lines individually for each chapter (up to 20) and each appendix (up to Z). The second chapter head is a new one dened by Jean-Marc Francois and he named it Bjornstrup. Originally, fncychap did not rely on any other package. However, for the style Lenny a postscript font is default, but this font can easily be changed. I encourage the use of the default postscript font since it is scalable in a truly huge manner, which makes Lenny nice. In the current release and with the use of Jean-Marcs Bjornstrup the color package from the base distribution will be invoked.

4 An simple example 5 Revision details

1 reg.

trademark of Ingvar Kamprad Emtaryd Agunnaryd

Hnh 3.13: Phn mc lc Bjornstrup

Hnh 3.14: u chng Bjornstrup

V
Ta c th nh ngha mt nh dng cho mnh. nh ngha li lnh \secdef v \renewcommand, Lnh

\DOCH
nh dng tn chng v s. Lnh

\DOTI{#1}
v

\DOTIS{#1}
nh dng tiu chng cho \chapter v \chapter*. Dng cu trc \makeatletter v ... \makeatother. nh ngha li cc thng s, c th cc bin di

\mylen, \myhi, \px, \py, \pxx, \pyy and \RW


ch rng \RW c bit v t \ChRuleWidth. iu khin bi \ChNameVar, \ChNumVar v \ChTitleVar ghi gi tr vo \CNV, \CNoV v \CTV tng ng. Cui cng hm \FmN{ } v\FmTi{ } tng ng nh \Ch***AsIs, \Ch***UpperCase and \Ch***LowerCase. Xt v d c th \makeatletter \ChNameVar{\Large\rm} % sets the style for name \ChNumVar{\Huge} % sets the style for digit \ChTitleVar{\Large\rm\centering} % sets the style for title \ChRuleWidth{4pt} % Set RW=4pt \ChNameUpperCase % Make name uppercase \renewcommand{\DOCH}{% \setlength{\fboxrule}{\RW} % Let fbox lines be controlled by % \ChRuleWidth \fbox{\CNV\FmN{\@chapapp}\space \CNoV\thechapter}\par\nobreak \vskip 40\p@} \renewcommand{\DOTI}[1]{%

http://nhdien.wordpress.com - Nguyn Hu in \CTV\FmTi{#1}\par\nobreak \vskip 40\p@} \renewcommand{\DOTIS}[1]{% \CTV\FmTi{#1}\par\nobreak \vskip 40\p@} \makeatother

[1] Ulf A. Lindgren, FncyChap V1.34, 2010. http://www.ctan.org/tex-archive/macros/latex/contrib/fncychap

You might also like