“Inspirational” quote at start of chapter
I recall seeing a package to make quotes like that of the following image at the start of a chapter, but I can't seem to find it again.
(This image is from the book Combinatorics and Graph Theory by Harris, Hirst, and Mossinghoff)
chapters quoting
add a comment |
I recall seeing a package to make quotes like that of the following image at the start of a chapter, but I can't seem to find it again.
(This image is from the book Combinatorics and Graph Theory by Harris, Hirst, and Mossinghoff)
chapters quoting
How to do just the beautiful quote in the first picture example by redefining newenvironment{quote} and also by defining my own myQuote{<quote>}{<my whom>} in documentclass{article}?
– user16637
Jul 15 '12 at 18:23
7
That is an awesome quote.
– Jason
Oct 20 '13 at 17:36
add a comment |
I recall seeing a package to make quotes like that of the following image at the start of a chapter, but I can't seem to find it again.
(This image is from the book Combinatorics and Graph Theory by Harris, Hirst, and Mossinghoff)
chapters quoting
I recall seeing a package to make quotes like that of the following image at the start of a chapter, but I can't seem to find it again.
(This image is from the book Combinatorics and Graph Theory by Harris, Hirst, and Mossinghoff)
chapters quoting
chapters quoting
edited Apr 26 '12 at 3:45
Werner
437k649601650
437k649601650
asked Apr 26 '12 at 3:10
Snowball
1,0903109
1,0903109
How to do just the beautiful quote in the first picture example by redefining newenvironment{quote} and also by defining my own myQuote{<quote>}{<my whom>} in documentclass{article}?
– user16637
Jul 15 '12 at 18:23
7
That is an awesome quote.
– Jason
Oct 20 '13 at 17:36
add a comment |
How to do just the beautiful quote in the first picture example by redefining newenvironment{quote} and also by defining my own myQuote{<quote>}{<my whom>} in documentclass{article}?
– user16637
Jul 15 '12 at 18:23
7
That is an awesome quote.
– Jason
Oct 20 '13 at 17:36
How to do just the beautiful quote in the first picture example by redefining newenvironment{quote} and also by defining my own myQuote{<quote>}{<my whom>} in documentclass{article}?
– user16637
Jul 15 '12 at 18:23
How to do just the beautiful quote in the first picture example by redefining newenvironment{quote} and also by defining my own myQuote{<quote>}{<my whom>} in documentclass{article}?
– user16637
Jul 15 '12 at 18:23
7
7
That is an awesome quote.
– Jason
Oct 20 '13 at 17:36
That is an awesome quote.
– Jason
Oct 20 '13 at 17:36
add a comment |
10 Answers
10
active
oldest
votes
I think it is the package epigraph
and is included in both TeX Live and MiKTeX distributions.
documentclass{book}
usepackage{epigraph}
begin{document}
chapter{First Chapter}
epigraph{I recall seeing a package to make quotes}{Snowball}
end{document}
29
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
3
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
3
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
add a comment |
The memoir
document class offers "out of the box" commands chapterprecis
, chapterprecishere
, and chapterprecistoc
:
documentclass{memoir}
begin{document}
chapter{Graph Theory}
chapterprecishere{``Begin at the beginning,¨ the King said gravely, ``and
go on till you come to the end: then stop."parraggedleft--- textup{Lewis
Carroll}, Alice in Wonderland}
end{document}
As Brent.Longborough mentions in his comment, memoir
also offers an epigraph
command and an epigraph
environment:
documentclass{memoir}
epigraphfontsize{smallitshape}
setlengthepigraphwidth{8cm}
setlengthepigraphrule{0pt}
begin{document}
chapter{Graph Theory}
epigraphfontsize{smallitshape}
epigraph{``Begin at the beginning," the King said gravely, ``and go on till you
come to the end: then stop."}{--- textup{Lewis Carroll}, Alice in Wonderland}
end{document}
10
memoir
also offers theepigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.
– Brent.Longborough
Apr 26 '12 at 10:42
2
@Brent.Longborough: I've added an example to my answer usingepigraph
; thank you.
– Gonzalo Medina
Apr 26 '12 at 12:04
2
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
1
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
1
For future readers: a noteworthy difference betweenepigraph
andchapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.
– Brighid McDonnell
Nov 8 '16 at 3:13
|
show 1 more comment
You can also do it yourself:
documentclass{book}
makeatletter
renewcommand{@chapapp}{}% Not necessary...
newenvironment{chapquote}[2][2em]
{setlength{@tempdima}{#1}%
defchapquote@author{#2}%
parshape 1 @tempdima dimexprtextwidth-2@tempdimarelax%
itshape}
{parnormalfonthfill-- chapquote@authorhspace*{@tempdima}parbigskip}
makeatother
begin{document}
chapter{Graph Theory}
begin{chapquote}{Lewis Carroll, textit{Alice in Wonderland}}
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
end{chapquote}
noindent The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
The above MWE provides the chapquote
environment that takes one argument - the author of the quote. It indents the quote by 2em (default), but that can also be changed via an optional argument:
begin{chapquote}[30pt]{author}
%... your quote
end{chapquote}
The default setting is in itshape
, with a right-aligned "author".
2
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
@YiannisLazarides: True, multiple paragraphs would cause problems when working withparshape
. In those instances, theadjustwidth
environment (fromchangepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issuepar
conditionally. Regardless, this provides one means to do it.
– Werner
Apr 26 '12 at 5:38
add a comment |
Since it hasn't been mentioned before: KOMA-Script also has built-in possibilities for this. There are two main commands of interest here. First
setchapterpreamble[<position>][<width>]{<preamble>}
where position is determined by one or two letters, o
(above the chapter) or u
(below the chapter) and l
,c
or r
(left-aligned, centered or right-aligned). It allows to put arbitrary stuff before or after the next chapter title without shifting the chapter title itself.
The second command is
dictum[<author>]{<quote>}
which sets the quote and can be used anywhere in the document.
The default settings look like this:
documentclass{scrbook}
usepackage[T1]{fontenc}
begin{document}
setchapterpreamble{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
They can be customized by a series of options and commands to obtain a similar output like in the picture of the question:
documentclass{scrbook}
usepackage[T1]{fontenc}
% customize chapter format:
KOMAoption{headings}{twolinechapter}
renewcommand*chapterformat{thechapterautodot}
% customize dictum format:
setkomafont{dictumtext}{itshapesmall}
setkomafont{dictumauthor}{normalfont}
renewcommand*dictumwidth{linewidth}
renewcommand*dictumauthorformat[1]{--- #1}
renewcommand*dictumrule{}
begin{document}
setchapterpreamble[uc][.75textwidth]{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}vskip1em}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
I updated your code torenewcommand*dictumauthorformat[1]{--- #1par}
and can now skipvskip1em
. Thanks!
– Dirk
Aug 3 '18 at 15:59
add a comment |
For the sake of completeness, I provide the following. It might be your alternate.
documentclass{book}
usepackage{quotchap}
begin{document}
begin{savequote}[0.55linewidth]
``Don't give up on your dreams, keep on sleeping.''
qauthor{Higgs Boson (2012 -- present)}
``Stick together team and hold this position!''
qauthor{Counter Terrorist (1999 -- present)}
end{savequote}
chapter{Introduction}
end{document}
More inspirational quotes
``If you're an underdog, mentally disabled, physically disabled, if you don't fit in, if you're not as pretty as the others, you can still be a hero, read TeX Book!''
qauthor{Bug Buster (2014 -- present)}
``Motivation isn't enough. If you've an idiot and you motivate him, now you've a motivated idiot.''
qauthor{Stiff Jokes (2014 -- present)}
``Learning (La)TeX, PSTricks, and PGF/TikZ is similar to learning how to swim or drive a car. You don’t get the full benefit by watching someone else do it. Your own fingers must get involved.''
qauthor{Donut E. Knot (2014 -- present)}
``Don't be lukewarm! If you cannot be the best, be the worst!''
qauthor{Code Mocker (2014 -- present)}
``Beauty without intelligence is a masterpiece painted on a toilet paper.''
qauthor{The Last Error (2014 -- present)}
``For every problem, there is always a solution that is simple, neat, but wrong.''
qauthor{Weirdstress Function (2014 -- present)}
6
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
1
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
add a comment |
An adaptation of a piece of code found on line but I do not remember where exactly.
documentclass[11pt]{book}
%%%%********************************************************************
usepackage{microtype}
usepackage{times}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage{graphicx}
usepackage{xcolor}
usepackage{lipsum}
%%%%********************************************************************
% fancy quotes
definecolor{quotemark}{gray}{0.7}
makeatletter
deffquote{%
@ifnextchar[{fquote@i}{fquote@i}%]
}%
deffquote@i[#1]{%
deftempa{#1}%
@ifnextchar[{fquote@ii}{fquote@ii}%]
}%
deffquote@ii[#1]{%
deftempb{#1}%
@ifnextchar[{fquote@iii}{fquote@iii}%]
}%
deffquote@iii[#1]{%
deftempc{#1}%
vspace{1em}%
noindent%
begin{list}{}{%
setlength{leftmargin}{0.1textwidth}%
setlength{rightmargin}{0.1textwidth}%
}%
item%
begin{picture}(0,0)%
put(-15,-5){makebox(0,0){scalebox{3}{textcolor{quotemark}{``}}}}%
end{picture}%
begingroupitshape}%
%%%%********************************************************************
defendfquote{%
endgrouppar%
makebox[0pt][l]{%
hspace{0.8textwidth}%
begin{picture}(0,0)(0,0)%
put(15,15){makebox(0,0){%
scalebox{3}{color{quotemark}''}}}%
end{picture}}%
ifxtempaempty%
else%
ifxtempcempty%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}%
else%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}, tempc%
fifipar%
vspace{0.5em}%
end{list}%
}%
makeatother
%%%%********************************************************************
begin{document}
chapter{Graph theory}
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
end{document}
2
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
add a comment |
And if you want to do yourself something very basic, just define a new command:
documentclass{book}
newcommand{chapquote}[3]{begin{quotation} textit{#1} end{quotation} begin{flushright} - #2, textit{#3}end{flushright} }
begin{document}
chapter{First Chapter}
chapquote{``Begin at the beginning,¨ the King said gravely, ``and go on till you come to the end: then stop."}{Lewis Carroll}{Alice in Wonderland}
end{document}
6
Since thequotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use{itshape#1}
instead oftextit{#1}
, astextit
does not permit paragraph breaks in its scope.
– Mico
Jan 20 '15 at 17:34
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
add a comment |
You can gain a finer control of the epigraph and chapter heading by the following package.
begin{filecontents}{chapterhead.sty}
NeedsTeXFormat{LaTeX2e}[2005/12/01]
ProvidesPackage{chapterhead}[2012/07/16 v0.0.1 Chapter head and epigraph (AM)]
RequirePackage{xkeyval}
RequirePackage{catoptions}
new@defchd@alltoendif#1endif{#1}
new@defchd@firsttoendif#1#2endif{#1}
new@def*chdifnumcmpTF#1#2#3{ifnumcmpTF#1#2{#3}}
% chdifchoice can be used to define choice keys via command keys:
new@def*chdifchoice{chdifcaseifstrcmpTF}
new@def*chdifcase#1#2{%
ifstrcmpTF{#1}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#1}endif{}{%
ifstrcmpTF{#2}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#2}endif{}{chd@ifcase{#1}{#2}}%
}%
}%
}%
}
new@def*chd@ifcase#1#2#3{%
ifstrcmpTF{#3}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#3}endif{}{%
#1{#2}{#3}chd@firsttoendif{chd@ifcase@i{#1}{#2}}%
}%
}%
}
new@def*chd@ifcase@i#1#2#3{chd@ifcase{#1}{#2}}
define@cmdkey[DKV]{definekeys}[defkey@]{prefix}[KV]{}
define@cmdkey[DKV]{definekeys}[defkey@]{family}{}
define@cmdkey[DKV]{definekeys}[defkey@]{holder prefix}[mp@]{}
define@boolkey[DKV]{definekeys}[defkey@]{initialize}[true]{}
define@boolkey[DKV]{definekeys}[defkey@]{preset}[true]{}
% Keys not specified in the optional argument of chddefinekeys will
% get default values:
presetkeys[DKV]{definekeys}{prefix,family,holder prefix,
initialize=false,preset=false}{}
robust@def*chddefinekeys{@testoptchd@definekeys{}}
new@def*chd@definekeys[#1]#2{%
setkeys[DKV]{definekeys}{#1}%
defdefkey@defaultlist{}%
edefreserved@a{cptcommanormalize{#2}}%
expandafterdefkey@loopreserved@a,defkey@nil,%
ifboolTF{defkey@preset}{%
cptexpanded{noexpandpresetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}{}%
}%
}{}%
ifboolTF{defkey@initialize}{%
cptexpanded{noexpandsetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}%
}%
}{}%
}
begingroup
lccode`&=1 catcode`&=7
lowercase{endgroup
new@def*chd@rejecttoks{&}%
new@def*defkey@loop#1,{%
defreserved@a{defkey@nil}%
edefreserved@b{cpttrimspace{#1}}%
ifxreserved@areserved@bexpandafter@gobbleelseexpandafter@idenfi
{defkey@splitatslash#1/&/&/&/&/&/&/&/defkey@nildefkey@loop}%
}
}
new@def*chd@cmprejecttoks#1{ifx#1chd@rejecttokselseexpandcsonce#1fi}
new@def*defkey@splitatslash#1/#2/#3/#4/#5/#6/#7/#8/#9defkey@nil{%
edefkeytype{cpttrimspace{#1}}%
edefkeyname{cpttrimspace{#2}}%
edefkeydefault{cpttrimspace{#3}}%
edefkeycode{cpttrimspace{#4}}%
ifxkeynamechd@rejecttoks
@latexerr{Empty key name}@ehd
fi
defreserved@a##1{%
defreserved@a####1##1####2####3@nil{%
defreserved@a{####2}%
}%
reserved@a cmd{0}bool{1}@nil
}%
expandafterreserved@aexpandafter{keytype}%
ifcasereserved@arelax
letreserved@adefine@cmdkey
or
xifinsetTF{,cptoxdetokkeydefault,}{,detokenize{true,false},}{%
letreserved@adefine@boolkey
}{%
@latexerr{Illegal default value 'cptoxdetokkeydefault'
MessageBreak for bool key 'keyname'}@ehd
}%
else
@latexerr{Illegal key type '#1'}@ehd
fi
cptexpanded{noexpandreserved@a
[defkey@prefix]{defkey@family}[usecsn{defkey@holder prefix}]%
{chd@cmprejecttokskeyname}%
ifxkeydefaultchd@rejecttokselse[expandcsoncekeydefault]fi
{chd@cmprejecttokskeycode}%
}%
edefdefkey@defaultlist{%
ifxdefkey@defaultlist@emptyelseexpandcsoncedefkey@defaultlist,fi
keyname
ifxkeydefaultchd@rejecttokselse=%
oifstrcmpTFkeytype{bool}{%
oifstrcmpTFkeydefault{true}{false}{false}%
}{%
expandcsoncekeydefault
}%
fi
}%
}
chddefinekeys[
prefix=CHD,family=epigraf,holder prefix=epg@,initialize,preset
]{%
cmd/width/hsize,
cmd/author/,
cmd/color/black,
cmd/authorcolor/black,
bool/use italics for author/true,
cmd/fontencoding/encodingdefault,
cmd/fontfamily/familydefault,
cmd/fontseries/seriesdefault,
cmd/fontshape/shapedefault,
cmd/fontsize/10pt,
cmd/hskip/0ex,
cmd/prevskip/0ex,
cmd/postvskip/1ex,
bool/frame/true,
}
chddefinekeys[
prefix=CHD,family=chapterhead,holder prefix=chd@,initialize,preset
]{%
cmd/textcolor/black,
cmd/textfontencoding/encodingdefault,
cmd/textfontfamily/familydefault,
cmd/textfontseries/eb,
cmd/textfontshape/shapedefault,
cmd/textfontsize/100pt,
cmd/numberfontencoding/encodingdefault,
cmd/numberfontfamily/familydefault,
cmd/numberfontseries/eb,
cmd/numberfontshape/shapedefault,
cmd/numberfontsize/100pt,
% cmd/leftmargin/leftmargin,
% cmd/rightmargin/rightmargin,
cmd/texthskip/0em,
cmd/textprevskip/0ex,
cmd/textpostvskip/1ex,
cmd/numberprevskip/0ex,
cmd/numberpostvskip/0ex,
cmd/numberhskip/0em,
cmd/numbercolor/black,
cmd/pagestyle/empty,
bool/make text raggedleft/true,
bool/make number raggedleft/true,
bool/print number before text/true,
bool/frame number/true,
bool/no clear page/true
}
newboxchd@boxa
newcommandepigraf[2]{%
setkeys[CHD]{epigraf}{#1}%
setboxchd@boxa=vbox{%
ifepg@framefbox{fi
parboxepg@width{%
fontsize{epg@fontsize}{1.5epg@fontsize}%
usefont{epg@fontencoding}{epg@fontfamily}%
{epg@fontseries}{epg@fontshape}%
ignorespaces
textcolor{epg@color}{#2}%
hspace*{fill}nolinebreak[1]%
quadhspace*{fill}finalhyphendemeritsz@ptrelax
begingroup
ifboolTF{epg@use italics for author}{itshape}{}%
textcolor{epg@authorcolor}{epg@author}%
endgroup
}%
ifepg@frame}fi
}%
globalletchd@printepigrafchd@bprintepigraf
@ignoretrue
}
AtBeginDocument{%
@ifundefined{@mainmattertrue}{newifif@mainmatter@mainmattertrue}{}%
}
new@def*chd@insertchaptertext#1{%
begingroup
ifboolTF{chd@make text raggedleft}{%
raggedleft
}{%
hskipchd@texthskiprelax
}%
advanceleftmargin10em
interlinepenalty@M
vskipchd@textprevskiprelax
fontsize{chd@textfontsize}{1.2chd@textfontsize}%
usefont{chd@textfontencoding}{chd@textfontfamily}%
{chd@textfontseries}{chd@textfontshape}%
textcolor{chd@textcolor}{ignorespaces#1}%
parnobreak
vskipchd@textpostvskiprelax
endgroup
}
new@def*chd@insertchapternumber{%
begingroup
ifnumc@secnumdepth>m@ne
if@mainmatter
vskipchd@numberprevskiprelax
fontsize{chd@numberfontsize}{1.2chd@numberfontsize}%
usefont{chd@numberfontencoding}{chd@numberfontfamily}%
{chd@numberfontseries}{chd@numberfontshape}%
usecsn{ifchd@frame number}fbox{fi
textcolor{chd@numbercolor}{thechapter}%
usecsn{ifchd@frame number}}fi
parnobreak
vskipchd@numberpostvskiprelax
fi
fi
endgroup
}
renewcommandchapter[1]{%
setkeys[CHD]{chapterhead}{#1}%
ifboolTF{chd@no clear page}{}{%
if@openrightcleardoublepageelseclearpagefi
}%
thispagestyle{chd@pagestyle}%
global@topnumz@
ifdefTFchd@printepigrafchd@printepigrafrelax
@afterindentfalse
secdef@chapter@schapter
}
renewcommand{@makechapterhead}[1]{%
begingroup
begingroup
leavevmode
ifboolTF{chd@make number raggedleft}{%
raggedleft
}{%
hskipchd@numberhskiprelax
}%
ifboolTF{chd@print number before text}{%
chd@insertchapternumberchd@insertchaptertext{#1}%
}{%
chd@insertchaptertext{#1}chd@insertchapternumber
}%
endgroup
nobreak
endgroup
}
renewcommand{@makeschapterhead}[1]{%
begingroup
letc@secnumdepthm@ne@makechapterhead{#1}%
endgroup
}
newcommand*chd@bprintepigraf{%
vskipepg@prevskip
hskipepg@hskiprelax
copychd@boxa
vskipepg@postvskip
globalletchd@printepigrafrelax
}
endinput
end{filecontents}
documentclass{book}
usepackage{chapterhead}
usepackage[dvipsnames]{xcolor}
begin{document}
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=blue,
width=.75hsize,
use italics for author=false,
fontsize=8pt,
fontfamily=cmr,
hskip=10em,
postvskip=2ex,
frame,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmbr,
textfontshape=it,% not obtainable because of other choices above
textcolor=red,
make text raggedleft=false,
make number raggedleft=false,
print number before text,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
parvskip3baselineskip
hrule height.5pt depth .4pt relax
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=black,
width=.75hsize,
use italics for author,
fontsize=8pt,
fontfamily=cmr,
hskip=-3em,
prevskip=2ex,
postvskip=2ex,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmss,
textfontshape=it,
textcolor=Brown,
numbercolor=ForestGreen,
make text raggedleft,
make number raggedleft,
frame number,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
end{document}
add a comment |
edit: on second look, my answer is highly similar to wondering's answer
I wanted to do something similar, and came up with a simple and (imo) clean way of reproducing the style of the OP;
documentclass{book}
begin{document}
chapter{Inspirational Quote}
begin{flushright}
rightskip=1.8cmtextit{``Dis-moi ce que tu manges, je te dirai ce que tu es.''} \
vspace{.2em}
rightskip=.8cm---Jean Anthelme Brillat-Savarin
end{flushright}
vspace{1em}
noindent
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{document}
(the additional rightskip
s + vspace
s are just for prettiness sake).
Which results in:
Unless you changedbook.cls
your code does not produce the outcome your picture shows.
– clemens
Sep 21 '16 at 11:39
add a comment |
There is a package called "dirtytalk". Here is the code snippet:
chapter{Graph Theory}
say{textit{Beginning at the beginning,}} textit{the King said gravely,}
say{textit{and go on till you come to the end; then stop.}} --- textit{Lewis Carroll, Alice in Wonderland}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f53377%2finspirational-quote-at-start-of-chapter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
10 Answers
10
active
oldest
votes
10 Answers
10
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think it is the package epigraph
and is included in both TeX Live and MiKTeX distributions.
documentclass{book}
usepackage{epigraph}
begin{document}
chapter{First Chapter}
epigraph{I recall seeing a package to make quotes}{Snowball}
end{document}
29
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
3
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
3
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
add a comment |
I think it is the package epigraph
and is included in both TeX Live and MiKTeX distributions.
documentclass{book}
usepackage{epigraph}
begin{document}
chapter{First Chapter}
epigraph{I recall seeing a package to make quotes}{Snowball}
end{document}
29
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
3
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
3
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
add a comment |
I think it is the package epigraph
and is included in both TeX Live and MiKTeX distributions.
documentclass{book}
usepackage{epigraph}
begin{document}
chapter{First Chapter}
epigraph{I recall seeing a package to make quotes}{Snowball}
end{document}
I think it is the package epigraph
and is included in both TeX Live and MiKTeX distributions.
documentclass{book}
usepackage{epigraph}
begin{document}
chapter{First Chapter}
epigraph{I recall seeing a package to make quotes}{Snowball}
end{document}
edited Jul 15 '12 at 18:50
doncherry
34.7k23135208
34.7k23135208
answered Apr 26 '12 at 3:27
R. Schumacher
8,36122238
8,36122238
29
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
3
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
3
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
add a comment |
29
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
3
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
3
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
29
29
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
I had to laugh out loud when I read the quote. Thanks for that. ;-)
– mre
Aug 28 '13 at 22:53
3
3
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
Is there a way to change the width of the line?
– Germano Massullo
Apr 16 '16 at 11:33
3
3
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
@Caterpillar Put setlength{epigraphwidth}{3in} before the use of the epigraph command. Select a length appropriate to your needs. Reference: pg3 from texdoc.net/texmf-dist/doc/latex/epigraph/epigraph.pdf
– R. Schumacher
Apr 16 '16 at 18:39
add a comment |
The memoir
document class offers "out of the box" commands chapterprecis
, chapterprecishere
, and chapterprecistoc
:
documentclass{memoir}
begin{document}
chapter{Graph Theory}
chapterprecishere{``Begin at the beginning,¨ the King said gravely, ``and
go on till you come to the end: then stop."parraggedleft--- textup{Lewis
Carroll}, Alice in Wonderland}
end{document}
As Brent.Longborough mentions in his comment, memoir
also offers an epigraph
command and an epigraph
environment:
documentclass{memoir}
epigraphfontsize{smallitshape}
setlengthepigraphwidth{8cm}
setlengthepigraphrule{0pt}
begin{document}
chapter{Graph Theory}
epigraphfontsize{smallitshape}
epigraph{``Begin at the beginning," the King said gravely, ``and go on till you
come to the end: then stop."}{--- textup{Lewis Carroll}, Alice in Wonderland}
end{document}
10
memoir
also offers theepigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.
– Brent.Longborough
Apr 26 '12 at 10:42
2
@Brent.Longborough: I've added an example to my answer usingepigraph
; thank you.
– Gonzalo Medina
Apr 26 '12 at 12:04
2
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
1
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
1
For future readers: a noteworthy difference betweenepigraph
andchapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.
– Brighid McDonnell
Nov 8 '16 at 3:13
|
show 1 more comment
The memoir
document class offers "out of the box" commands chapterprecis
, chapterprecishere
, and chapterprecistoc
:
documentclass{memoir}
begin{document}
chapter{Graph Theory}
chapterprecishere{``Begin at the beginning,¨ the King said gravely, ``and
go on till you come to the end: then stop."parraggedleft--- textup{Lewis
Carroll}, Alice in Wonderland}
end{document}
As Brent.Longborough mentions in his comment, memoir
also offers an epigraph
command and an epigraph
environment:
documentclass{memoir}
epigraphfontsize{smallitshape}
setlengthepigraphwidth{8cm}
setlengthepigraphrule{0pt}
begin{document}
chapter{Graph Theory}
epigraphfontsize{smallitshape}
epigraph{``Begin at the beginning," the King said gravely, ``and go on till you
come to the end: then stop."}{--- textup{Lewis Carroll}, Alice in Wonderland}
end{document}
10
memoir
also offers theepigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.
– Brent.Longborough
Apr 26 '12 at 10:42
2
@Brent.Longborough: I've added an example to my answer usingepigraph
; thank you.
– Gonzalo Medina
Apr 26 '12 at 12:04
2
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
1
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
1
For future readers: a noteworthy difference betweenepigraph
andchapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.
– Brighid McDonnell
Nov 8 '16 at 3:13
|
show 1 more comment
The memoir
document class offers "out of the box" commands chapterprecis
, chapterprecishere
, and chapterprecistoc
:
documentclass{memoir}
begin{document}
chapter{Graph Theory}
chapterprecishere{``Begin at the beginning,¨ the King said gravely, ``and
go on till you come to the end: then stop."parraggedleft--- textup{Lewis
Carroll}, Alice in Wonderland}
end{document}
As Brent.Longborough mentions in his comment, memoir
also offers an epigraph
command and an epigraph
environment:
documentclass{memoir}
epigraphfontsize{smallitshape}
setlengthepigraphwidth{8cm}
setlengthepigraphrule{0pt}
begin{document}
chapter{Graph Theory}
epigraphfontsize{smallitshape}
epigraph{``Begin at the beginning," the King said gravely, ``and go on till you
come to the end: then stop."}{--- textup{Lewis Carroll}, Alice in Wonderland}
end{document}
The memoir
document class offers "out of the box" commands chapterprecis
, chapterprecishere
, and chapterprecistoc
:
documentclass{memoir}
begin{document}
chapter{Graph Theory}
chapterprecishere{``Begin at the beginning,¨ the King said gravely, ``and
go on till you come to the end: then stop."parraggedleft--- textup{Lewis
Carroll}, Alice in Wonderland}
end{document}
As Brent.Longborough mentions in his comment, memoir
also offers an epigraph
command and an epigraph
environment:
documentclass{memoir}
epigraphfontsize{smallitshape}
setlengthepigraphwidth{8cm}
setlengthepigraphrule{0pt}
begin{document}
chapter{Graph Theory}
epigraphfontsize{smallitshape}
epigraph{``Begin at the beginning," the King said gravely, ``and go on till you
come to the end: then stop."}{--- textup{Lewis Carroll}, Alice in Wonderland}
end{document}
edited Sep 20 '16 at 0:22
9999years
24418
24418
answered Apr 26 '12 at 3:45
Gonzalo Medina
395k4113001566
395k4113001566
10
memoir
also offers theepigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.
– Brent.Longborough
Apr 26 '12 at 10:42
2
@Brent.Longborough: I've added an example to my answer usingepigraph
; thank you.
– Gonzalo Medina
Apr 26 '12 at 12:04
2
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
1
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
1
For future readers: a noteworthy difference betweenepigraph
andchapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.
– Brighid McDonnell
Nov 8 '16 at 3:13
|
show 1 more comment
10
memoir
also offers theepigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.
– Brent.Longborough
Apr 26 '12 at 10:42
2
@Brent.Longborough: I've added an example to my answer usingepigraph
; thank you.
– Gonzalo Medina
Apr 26 '12 at 12:04
2
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
1
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
1
For future readers: a noteworthy difference betweenepigraph
andchapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.
– Brighid McDonnell
Nov 8 '16 at 3:13
10
10
memoir
also offers the epigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.– Brent.Longborough
Apr 26 '12 at 10:42
memoir
also offers the epigraph
command, as well as the epigraphs environment. Putting on my semantic pedant's hat, this case (and the OP's intent) is, I think, strictly an epigraph; a chapter précis is meant to be an additional information key, rather than amusement.– Brent.Longborough
Apr 26 '12 at 10:42
2
2
@Brent.Longborough: I've added an example to my answer using
epigraph
; thank you.– Gonzalo Medina
Apr 26 '12 at 12:04
@Brent.Longborough: I've added an example to my answer using
epigraph
; thank you.– Gonzalo Medina
Apr 26 '12 at 12:04
2
2
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
@cfr OH, now my brain hurts; 'Venn diagram needed'.
– Brent.Longborough
Apr 14 '14 at 4:07
1
1
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
@Brent.Longborough Not possible in a comment ;).
– cfr
Apr 14 '14 at 9:54
1
1
For future readers: a noteworthy difference between
epigraph
and chapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.– Brighid McDonnell
Nov 8 '16 at 3:13
For future readers: a noteworthy difference between
epigraph
and chapterprecis
is that by default the latter appears in the table of contents as well as in the chapter. This may or may not be what you want.– Brighid McDonnell
Nov 8 '16 at 3:13
|
show 1 more comment
You can also do it yourself:
documentclass{book}
makeatletter
renewcommand{@chapapp}{}% Not necessary...
newenvironment{chapquote}[2][2em]
{setlength{@tempdima}{#1}%
defchapquote@author{#2}%
parshape 1 @tempdima dimexprtextwidth-2@tempdimarelax%
itshape}
{parnormalfonthfill-- chapquote@authorhspace*{@tempdima}parbigskip}
makeatother
begin{document}
chapter{Graph Theory}
begin{chapquote}{Lewis Carroll, textit{Alice in Wonderland}}
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
end{chapquote}
noindent The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
The above MWE provides the chapquote
environment that takes one argument - the author of the quote. It indents the quote by 2em (default), but that can also be changed via an optional argument:
begin{chapquote}[30pt]{author}
%... your quote
end{chapquote}
The default setting is in itshape
, with a right-aligned "author".
2
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
@YiannisLazarides: True, multiple paragraphs would cause problems when working withparshape
. In those instances, theadjustwidth
environment (fromchangepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issuepar
conditionally. Regardless, this provides one means to do it.
– Werner
Apr 26 '12 at 5:38
add a comment |
You can also do it yourself:
documentclass{book}
makeatletter
renewcommand{@chapapp}{}% Not necessary...
newenvironment{chapquote}[2][2em]
{setlength{@tempdima}{#1}%
defchapquote@author{#2}%
parshape 1 @tempdima dimexprtextwidth-2@tempdimarelax%
itshape}
{parnormalfonthfill-- chapquote@authorhspace*{@tempdima}parbigskip}
makeatother
begin{document}
chapter{Graph Theory}
begin{chapquote}{Lewis Carroll, textit{Alice in Wonderland}}
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
end{chapquote}
noindent The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
The above MWE provides the chapquote
environment that takes one argument - the author of the quote. It indents the quote by 2em (default), but that can also be changed via an optional argument:
begin{chapquote}[30pt]{author}
%... your quote
end{chapquote}
The default setting is in itshape
, with a right-aligned "author".
2
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
@YiannisLazarides: True, multiple paragraphs would cause problems when working withparshape
. In those instances, theadjustwidth
environment (fromchangepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issuepar
conditionally. Regardless, this provides one means to do it.
– Werner
Apr 26 '12 at 5:38
add a comment |
You can also do it yourself:
documentclass{book}
makeatletter
renewcommand{@chapapp}{}% Not necessary...
newenvironment{chapquote}[2][2em]
{setlength{@tempdima}{#1}%
defchapquote@author{#2}%
parshape 1 @tempdima dimexprtextwidth-2@tempdimarelax%
itshape}
{parnormalfonthfill-- chapquote@authorhspace*{@tempdima}parbigskip}
makeatother
begin{document}
chapter{Graph Theory}
begin{chapquote}{Lewis Carroll, textit{Alice in Wonderland}}
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
end{chapquote}
noindent The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
The above MWE provides the chapquote
environment that takes one argument - the author of the quote. It indents the quote by 2em (default), but that can also be changed via an optional argument:
begin{chapquote}[30pt]{author}
%... your quote
end{chapquote}
The default setting is in itshape
, with a right-aligned "author".
You can also do it yourself:
documentclass{book}
makeatletter
renewcommand{@chapapp}{}% Not necessary...
newenvironment{chapquote}[2][2em]
{setlength{@tempdima}{#1}%
defchapquote@author{#2}%
parshape 1 @tempdima dimexprtextwidth-2@tempdimarelax%
itshape}
{parnormalfonthfill-- chapquote@authorhspace*{@tempdima}parbigskip}
makeatother
begin{document}
chapter{Graph Theory}
begin{chapquote}{Lewis Carroll, textit{Alice in Wonderland}}
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
end{chapquote}
noindent The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
The above MWE provides the chapquote
environment that takes one argument - the author of the quote. It indents the quote by 2em (default), but that can also be changed via an optional argument:
begin{chapquote}[30pt]{author}
%... your quote
end{chapquote}
The default setting is in itshape
, with a right-aligned "author".
answered Apr 26 '12 at 3:45
Werner
437k649601650
437k649601650
2
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
@YiannisLazarides: True, multiple paragraphs would cause problems when working withparshape
. In those instances, theadjustwidth
environment (fromchangepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issuepar
conditionally. Regardless, this provides one means to do it.
– Werner
Apr 26 '12 at 5:38
add a comment |
2
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
@YiannisLazarides: True, multiple paragraphs would cause problems when working withparshape
. In those instances, theadjustwidth
environment (fromchangepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issuepar
conditionally. Regardless, this provides one means to do it.
– Werner
Apr 26 '12 at 5:38
2
2
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
What happens if the epigraph is made of one or more paragraphs? Also for very short quotes the author/source is normally set as one line.
– Yiannis Lazarides
Apr 26 '12 at 5:26
@YiannisLazarides: True, multiple paragraphs would cause problems when working with
parshape
. In those instances, the adjustwidth
environment (from changepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issue par
conditionally. Regardless, this provides one means to do it.– Werner
Apr 26 '12 at 5:38
@YiannisLazarides: True, multiple paragraphs would cause problems when working with
parshape
. In those instances, the adjustwidth
environment (from changepage
) would be more appropriate. Regarding the alignment: All things are subject to change, based on the OP's requirement. For example, one could box the content to check for line length and issue par
conditionally. Regardless, this provides one means to do it.– Werner
Apr 26 '12 at 5:38
add a comment |
Since it hasn't been mentioned before: KOMA-Script also has built-in possibilities for this. There are two main commands of interest here. First
setchapterpreamble[<position>][<width>]{<preamble>}
where position is determined by one or two letters, o
(above the chapter) or u
(below the chapter) and l
,c
or r
(left-aligned, centered or right-aligned). It allows to put arbitrary stuff before or after the next chapter title without shifting the chapter title itself.
The second command is
dictum[<author>]{<quote>}
which sets the quote and can be used anywhere in the document.
The default settings look like this:
documentclass{scrbook}
usepackage[T1]{fontenc}
begin{document}
setchapterpreamble{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
They can be customized by a series of options and commands to obtain a similar output like in the picture of the question:
documentclass{scrbook}
usepackage[T1]{fontenc}
% customize chapter format:
KOMAoption{headings}{twolinechapter}
renewcommand*chapterformat{thechapterautodot}
% customize dictum format:
setkomafont{dictumtext}{itshapesmall}
setkomafont{dictumauthor}{normalfont}
renewcommand*dictumwidth{linewidth}
renewcommand*dictumauthorformat[1]{--- #1}
renewcommand*dictumrule{}
begin{document}
setchapterpreamble[uc][.75textwidth]{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}vskip1em}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
I updated your code torenewcommand*dictumauthorformat[1]{--- #1par}
and can now skipvskip1em
. Thanks!
– Dirk
Aug 3 '18 at 15:59
add a comment |
Since it hasn't been mentioned before: KOMA-Script also has built-in possibilities for this. There are two main commands of interest here. First
setchapterpreamble[<position>][<width>]{<preamble>}
where position is determined by one or two letters, o
(above the chapter) or u
(below the chapter) and l
,c
or r
(left-aligned, centered or right-aligned). It allows to put arbitrary stuff before or after the next chapter title without shifting the chapter title itself.
The second command is
dictum[<author>]{<quote>}
which sets the quote and can be used anywhere in the document.
The default settings look like this:
documentclass{scrbook}
usepackage[T1]{fontenc}
begin{document}
setchapterpreamble{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
They can be customized by a series of options and commands to obtain a similar output like in the picture of the question:
documentclass{scrbook}
usepackage[T1]{fontenc}
% customize chapter format:
KOMAoption{headings}{twolinechapter}
renewcommand*chapterformat{thechapterautodot}
% customize dictum format:
setkomafont{dictumtext}{itshapesmall}
setkomafont{dictumauthor}{normalfont}
renewcommand*dictumwidth{linewidth}
renewcommand*dictumauthorformat[1]{--- #1}
renewcommand*dictumrule{}
begin{document}
setchapterpreamble[uc][.75textwidth]{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}vskip1em}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
I updated your code torenewcommand*dictumauthorformat[1]{--- #1par}
and can now skipvskip1em
. Thanks!
– Dirk
Aug 3 '18 at 15:59
add a comment |
Since it hasn't been mentioned before: KOMA-Script also has built-in possibilities for this. There are two main commands of interest here. First
setchapterpreamble[<position>][<width>]{<preamble>}
where position is determined by one or two letters, o
(above the chapter) or u
(below the chapter) and l
,c
or r
(left-aligned, centered or right-aligned). It allows to put arbitrary stuff before or after the next chapter title without shifting the chapter title itself.
The second command is
dictum[<author>]{<quote>}
which sets the quote and can be used anywhere in the document.
The default settings look like this:
documentclass{scrbook}
usepackage[T1]{fontenc}
begin{document}
setchapterpreamble{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
They can be customized by a series of options and commands to obtain a similar output like in the picture of the question:
documentclass{scrbook}
usepackage[T1]{fontenc}
% customize chapter format:
KOMAoption{headings}{twolinechapter}
renewcommand*chapterformat{thechapterautodot}
% customize dictum format:
setkomafont{dictumtext}{itshapesmall}
setkomafont{dictumauthor}{normalfont}
renewcommand*dictumwidth{linewidth}
renewcommand*dictumauthorformat[1]{--- #1}
renewcommand*dictumrule{}
begin{document}
setchapterpreamble[uc][.75textwidth]{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}vskip1em}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
Since it hasn't been mentioned before: KOMA-Script also has built-in possibilities for this. There are two main commands of interest here. First
setchapterpreamble[<position>][<width>]{<preamble>}
where position is determined by one or two letters, o
(above the chapter) or u
(below the chapter) and l
,c
or r
(left-aligned, centered or right-aligned). It allows to put arbitrary stuff before or after the next chapter title without shifting the chapter title itself.
The second command is
dictum[<author>]{<quote>}
which sets the quote and can be used anywhere in the document.
The default settings look like this:
documentclass{scrbook}
usepackage[T1]{fontenc}
begin{document}
setchapterpreamble{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
They can be customized by a series of options and commands to obtain a similar output like in the picture of the question:
documentclass{scrbook}
usepackage[T1]{fontenc}
% customize chapter format:
KOMAoption{headings}{twolinechapter}
renewcommand*chapterformat{thechapterautodot}
% customize dictum format:
setkomafont{dictumtext}{itshapesmall}
setkomafont{dictumauthor}{normalfont}
renewcommand*dictumwidth{linewidth}
renewcommand*dictumauthorformat[1]{--- #1}
renewcommand*dictumrule{}
begin{document}
setchapterpreamble[uc][.75textwidth]{%
dictum[Lewis Carroll, textit{Alice in Wonderland}]{%
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''}vskip1em}
chapter{Graph Theory}
The Pregolya River passes through the city once known as K"onigsberg. In the 1700s
seven bridges were situated across this river in a manner similar to what you see
in Figure ldots
end{document}
edited Apr 26 '12 at 21:58
answered Apr 26 '12 at 15:17
clemens
51.1k5129277
51.1k5129277
I updated your code torenewcommand*dictumauthorformat[1]{--- #1par}
and can now skipvskip1em
. Thanks!
– Dirk
Aug 3 '18 at 15:59
add a comment |
I updated your code torenewcommand*dictumauthorformat[1]{--- #1par}
and can now skipvskip1em
. Thanks!
– Dirk
Aug 3 '18 at 15:59
I updated your code to
renewcommand*dictumauthorformat[1]{--- #1par}
and can now skip vskip1em
. Thanks!– Dirk
Aug 3 '18 at 15:59
I updated your code to
renewcommand*dictumauthorformat[1]{--- #1par}
and can now skip vskip1em
. Thanks!– Dirk
Aug 3 '18 at 15:59
add a comment |
For the sake of completeness, I provide the following. It might be your alternate.
documentclass{book}
usepackage{quotchap}
begin{document}
begin{savequote}[0.55linewidth]
``Don't give up on your dreams, keep on sleeping.''
qauthor{Higgs Boson (2012 -- present)}
``Stick together team and hold this position!''
qauthor{Counter Terrorist (1999 -- present)}
end{savequote}
chapter{Introduction}
end{document}
More inspirational quotes
``If you're an underdog, mentally disabled, physically disabled, if you don't fit in, if you're not as pretty as the others, you can still be a hero, read TeX Book!''
qauthor{Bug Buster (2014 -- present)}
``Motivation isn't enough. If you've an idiot and you motivate him, now you've a motivated idiot.''
qauthor{Stiff Jokes (2014 -- present)}
``Learning (La)TeX, PSTricks, and PGF/TikZ is similar to learning how to swim or drive a car. You don’t get the full benefit by watching someone else do it. Your own fingers must get involved.''
qauthor{Donut E. Knot (2014 -- present)}
``Don't be lukewarm! If you cannot be the best, be the worst!''
qauthor{Code Mocker (2014 -- present)}
``Beauty without intelligence is a masterpiece painted on a toilet paper.''
qauthor{The Last Error (2014 -- present)}
``For every problem, there is always a solution that is simple, neat, but wrong.''
qauthor{Weirdstress Function (2014 -- present)}
6
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
1
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
add a comment |
For the sake of completeness, I provide the following. It might be your alternate.
documentclass{book}
usepackage{quotchap}
begin{document}
begin{savequote}[0.55linewidth]
``Don't give up on your dreams, keep on sleeping.''
qauthor{Higgs Boson (2012 -- present)}
``Stick together team and hold this position!''
qauthor{Counter Terrorist (1999 -- present)}
end{savequote}
chapter{Introduction}
end{document}
More inspirational quotes
``If you're an underdog, mentally disabled, physically disabled, if you don't fit in, if you're not as pretty as the others, you can still be a hero, read TeX Book!''
qauthor{Bug Buster (2014 -- present)}
``Motivation isn't enough. If you've an idiot and you motivate him, now you've a motivated idiot.''
qauthor{Stiff Jokes (2014 -- present)}
``Learning (La)TeX, PSTricks, and PGF/TikZ is similar to learning how to swim or drive a car. You don’t get the full benefit by watching someone else do it. Your own fingers must get involved.''
qauthor{Donut E. Knot (2014 -- present)}
``Don't be lukewarm! If you cannot be the best, be the worst!''
qauthor{Code Mocker (2014 -- present)}
``Beauty without intelligence is a masterpiece painted on a toilet paper.''
qauthor{The Last Error (2014 -- present)}
``For every problem, there is always a solution that is simple, neat, but wrong.''
qauthor{Weirdstress Function (2014 -- present)}
6
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
1
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
add a comment |
For the sake of completeness, I provide the following. It might be your alternate.
documentclass{book}
usepackage{quotchap}
begin{document}
begin{savequote}[0.55linewidth]
``Don't give up on your dreams, keep on sleeping.''
qauthor{Higgs Boson (2012 -- present)}
``Stick together team and hold this position!''
qauthor{Counter Terrorist (1999 -- present)}
end{savequote}
chapter{Introduction}
end{document}
More inspirational quotes
``If you're an underdog, mentally disabled, physically disabled, if you don't fit in, if you're not as pretty as the others, you can still be a hero, read TeX Book!''
qauthor{Bug Buster (2014 -- present)}
``Motivation isn't enough. If you've an idiot and you motivate him, now you've a motivated idiot.''
qauthor{Stiff Jokes (2014 -- present)}
``Learning (La)TeX, PSTricks, and PGF/TikZ is similar to learning how to swim or drive a car. You don’t get the full benefit by watching someone else do it. Your own fingers must get involved.''
qauthor{Donut E. Knot (2014 -- present)}
``Don't be lukewarm! If you cannot be the best, be the worst!''
qauthor{Code Mocker (2014 -- present)}
``Beauty without intelligence is a masterpiece painted on a toilet paper.''
qauthor{The Last Error (2014 -- present)}
``For every problem, there is always a solution that is simple, neat, but wrong.''
qauthor{Weirdstress Function (2014 -- present)}
For the sake of completeness, I provide the following. It might be your alternate.
documentclass{book}
usepackage{quotchap}
begin{document}
begin{savequote}[0.55linewidth]
``Don't give up on your dreams, keep on sleeping.''
qauthor{Higgs Boson (2012 -- present)}
``Stick together team and hold this position!''
qauthor{Counter Terrorist (1999 -- present)}
end{savequote}
chapter{Introduction}
end{document}
More inspirational quotes
``If you're an underdog, mentally disabled, physically disabled, if you don't fit in, if you're not as pretty as the others, you can still be a hero, read TeX Book!''
qauthor{Bug Buster (2014 -- present)}
``Motivation isn't enough. If you've an idiot and you motivate him, now you've a motivated idiot.''
qauthor{Stiff Jokes (2014 -- present)}
``Learning (La)TeX, PSTricks, and PGF/TikZ is similar to learning how to swim or drive a car. You don’t get the full benefit by watching someone else do it. Your own fingers must get involved.''
qauthor{Donut E. Knot (2014 -- present)}
``Don't be lukewarm! If you cannot be the best, be the worst!''
qauthor{Code Mocker (2014 -- present)}
``Beauty without intelligence is a masterpiece painted on a toilet paper.''
qauthor{The Last Error (2014 -- present)}
``For every problem, there is always a solution that is simple, neat, but wrong.''
qauthor{Weirdstress Function (2014 -- present)}
edited Apr 13 '14 at 15:10
answered Apr 26 '12 at 12:25
kiss my armpit
12.6k20170403
12.6k20170403
6
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
1
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
add a comment |
6
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
1
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
6
6
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
+1: These quotes are truly inspirational. "Terrorits win!"
– Henri Menke
Mar 18 '14 at 21:07
1
1
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
@HenriMenke: There is a typo. It should be "Terrorists win!".
– kiss my armpit
Apr 13 '14 at 14:56
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
Could you tell my how you made the chapter look like this?
– Jon Snow
Oct 22 '17 at 7:04
add a comment |
An adaptation of a piece of code found on line but I do not remember where exactly.
documentclass[11pt]{book}
%%%%********************************************************************
usepackage{microtype}
usepackage{times}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage{graphicx}
usepackage{xcolor}
usepackage{lipsum}
%%%%********************************************************************
% fancy quotes
definecolor{quotemark}{gray}{0.7}
makeatletter
deffquote{%
@ifnextchar[{fquote@i}{fquote@i}%]
}%
deffquote@i[#1]{%
deftempa{#1}%
@ifnextchar[{fquote@ii}{fquote@ii}%]
}%
deffquote@ii[#1]{%
deftempb{#1}%
@ifnextchar[{fquote@iii}{fquote@iii}%]
}%
deffquote@iii[#1]{%
deftempc{#1}%
vspace{1em}%
noindent%
begin{list}{}{%
setlength{leftmargin}{0.1textwidth}%
setlength{rightmargin}{0.1textwidth}%
}%
item%
begin{picture}(0,0)%
put(-15,-5){makebox(0,0){scalebox{3}{textcolor{quotemark}{``}}}}%
end{picture}%
begingroupitshape}%
%%%%********************************************************************
defendfquote{%
endgrouppar%
makebox[0pt][l]{%
hspace{0.8textwidth}%
begin{picture}(0,0)(0,0)%
put(15,15){makebox(0,0){%
scalebox{3}{color{quotemark}''}}}%
end{picture}}%
ifxtempaempty%
else%
ifxtempcempty%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}%
else%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}, tempc%
fifipar%
vspace{0.5em}%
end{list}%
}%
makeatother
%%%%********************************************************************
begin{document}
chapter{Graph theory}
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
end{document}
2
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
add a comment |
An adaptation of a piece of code found on line but I do not remember where exactly.
documentclass[11pt]{book}
%%%%********************************************************************
usepackage{microtype}
usepackage{times}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage{graphicx}
usepackage{xcolor}
usepackage{lipsum}
%%%%********************************************************************
% fancy quotes
definecolor{quotemark}{gray}{0.7}
makeatletter
deffquote{%
@ifnextchar[{fquote@i}{fquote@i}%]
}%
deffquote@i[#1]{%
deftempa{#1}%
@ifnextchar[{fquote@ii}{fquote@ii}%]
}%
deffquote@ii[#1]{%
deftempb{#1}%
@ifnextchar[{fquote@iii}{fquote@iii}%]
}%
deffquote@iii[#1]{%
deftempc{#1}%
vspace{1em}%
noindent%
begin{list}{}{%
setlength{leftmargin}{0.1textwidth}%
setlength{rightmargin}{0.1textwidth}%
}%
item%
begin{picture}(0,0)%
put(-15,-5){makebox(0,0){scalebox{3}{textcolor{quotemark}{``}}}}%
end{picture}%
begingroupitshape}%
%%%%********************************************************************
defendfquote{%
endgrouppar%
makebox[0pt][l]{%
hspace{0.8textwidth}%
begin{picture}(0,0)(0,0)%
put(15,15){makebox(0,0){%
scalebox{3}{color{quotemark}''}}}%
end{picture}}%
ifxtempaempty%
else%
ifxtempcempty%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}%
else%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}, tempc%
fifipar%
vspace{0.5em}%
end{list}%
}%
makeatother
%%%%********************************************************************
begin{document}
chapter{Graph theory}
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
end{document}
2
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
add a comment |
An adaptation of a piece of code found on line but I do not remember where exactly.
documentclass[11pt]{book}
%%%%********************************************************************
usepackage{microtype}
usepackage{times}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage{graphicx}
usepackage{xcolor}
usepackage{lipsum}
%%%%********************************************************************
% fancy quotes
definecolor{quotemark}{gray}{0.7}
makeatletter
deffquote{%
@ifnextchar[{fquote@i}{fquote@i}%]
}%
deffquote@i[#1]{%
deftempa{#1}%
@ifnextchar[{fquote@ii}{fquote@ii}%]
}%
deffquote@ii[#1]{%
deftempb{#1}%
@ifnextchar[{fquote@iii}{fquote@iii}%]
}%
deffquote@iii[#1]{%
deftempc{#1}%
vspace{1em}%
noindent%
begin{list}{}{%
setlength{leftmargin}{0.1textwidth}%
setlength{rightmargin}{0.1textwidth}%
}%
item%
begin{picture}(0,0)%
put(-15,-5){makebox(0,0){scalebox{3}{textcolor{quotemark}{``}}}}%
end{picture}%
begingroupitshape}%
%%%%********************************************************************
defendfquote{%
endgrouppar%
makebox[0pt][l]{%
hspace{0.8textwidth}%
begin{picture}(0,0)(0,0)%
put(15,15){makebox(0,0){%
scalebox{3}{color{quotemark}''}}}%
end{picture}}%
ifxtempaempty%
else%
ifxtempcempty%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}%
else%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}, tempc%
fifipar%
vspace{0.5em}%
end{list}%
}%
makeatother
%%%%********************************************************************
begin{document}
chapter{Graph theory}
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
end{document}
An adaptation of a piece of code found on line but I do not remember where exactly.
documentclass[11pt]{book}
%%%%********************************************************************
usepackage{microtype}
usepackage{times}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage{graphicx}
usepackage{xcolor}
usepackage{lipsum}
%%%%********************************************************************
% fancy quotes
definecolor{quotemark}{gray}{0.7}
makeatletter
deffquote{%
@ifnextchar[{fquote@i}{fquote@i}%]
}%
deffquote@i[#1]{%
deftempa{#1}%
@ifnextchar[{fquote@ii}{fquote@ii}%]
}%
deffquote@ii[#1]{%
deftempb{#1}%
@ifnextchar[{fquote@iii}{fquote@iii}%]
}%
deffquote@iii[#1]{%
deftempc{#1}%
vspace{1em}%
noindent%
begin{list}{}{%
setlength{leftmargin}{0.1textwidth}%
setlength{rightmargin}{0.1textwidth}%
}%
item%
begin{picture}(0,0)%
put(-15,-5){makebox(0,0){scalebox{3}{textcolor{quotemark}{``}}}}%
end{picture}%
begingroupitshape}%
%%%%********************************************************************
defendfquote{%
endgrouppar%
makebox[0pt][l]{%
hspace{0.8textwidth}%
begin{picture}(0,0)(0,0)%
put(15,15){makebox(0,0){%
scalebox{3}{color{quotemark}''}}}%
end{picture}}%
ifxtempaempty%
else%
ifxtempcempty%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}%
else%
hfillrule{100pt}{0.5pt}\mbox{}hfilltempa, emph{tempb}, tempc%
fifipar%
vspace{0.5em}%
end{list}%
}%
makeatother
%%%%********************************************************************
begin{document}
chapter{Graph theory}
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
end{fquote}
lipsum[2]
end{document}
answered Apr 26 '12 at 15:47
pluton
7,955960131
7,955960131
2
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
add a comment |
2
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
2
2
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
This is beautiful and I'm using it in my PhD dissertation. Thank you, kind stranger :-)
– AllanM
Oct 30 '15 at 19:23
add a comment |
And if you want to do yourself something very basic, just define a new command:
documentclass{book}
newcommand{chapquote}[3]{begin{quotation} textit{#1} end{quotation} begin{flushright} - #2, textit{#3}end{flushright} }
begin{document}
chapter{First Chapter}
chapquote{``Begin at the beginning,¨ the King said gravely, ``and go on till you come to the end: then stop."}{Lewis Carroll}{Alice in Wonderland}
end{document}
6
Since thequotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use{itshape#1}
instead oftextit{#1}
, astextit
does not permit paragraph breaks in its scope.
– Mico
Jan 20 '15 at 17:34
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
add a comment |
And if you want to do yourself something very basic, just define a new command:
documentclass{book}
newcommand{chapquote}[3]{begin{quotation} textit{#1} end{quotation} begin{flushright} - #2, textit{#3}end{flushright} }
begin{document}
chapter{First Chapter}
chapquote{``Begin at the beginning,¨ the King said gravely, ``and go on till you come to the end: then stop."}{Lewis Carroll}{Alice in Wonderland}
end{document}
6
Since thequotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use{itshape#1}
instead oftextit{#1}
, astextit
does not permit paragraph breaks in its scope.
– Mico
Jan 20 '15 at 17:34
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
add a comment |
And if you want to do yourself something very basic, just define a new command:
documentclass{book}
newcommand{chapquote}[3]{begin{quotation} textit{#1} end{quotation} begin{flushright} - #2, textit{#3}end{flushright} }
begin{document}
chapter{First Chapter}
chapquote{``Begin at the beginning,¨ the King said gravely, ``and go on till you come to the end: then stop."}{Lewis Carroll}{Alice in Wonderland}
end{document}
And if you want to do yourself something very basic, just define a new command:
documentclass{book}
newcommand{chapquote}[3]{begin{quotation} textit{#1} end{quotation} begin{flushright} - #2, textit{#3}end{flushright} }
begin{document}
chapter{First Chapter}
chapquote{``Begin at the beginning,¨ the King said gravely, ``and go on till you come to the end: then stop."}{Lewis Carroll}{Alice in Wonderland}
end{document}
edited Jan 20 '15 at 17:21
answered Jan 20 '15 at 16:54
wondering
376214
376214
6
Since thequotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use{itshape#1}
instead oftextit{#1}
, astextit
does not permit paragraph breaks in its scope.
– Mico
Jan 20 '15 at 17:34
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
add a comment |
6
Since thequotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use{itshape#1}
instead oftextit{#1}
, astextit
does not permit paragraph breaks in its scope.
– Mico
Jan 20 '15 at 17:34
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
6
6
Since the
quotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use {itshape#1}
instead of textit{#1}
, as textit
does not permit paragraph breaks in its scope.– Mico
Jan 20 '15 at 17:34
Since the
quotation
paragraph allows paragraph breaks, and some users may therefore be tempted to provide a two-paragraph inspirational quote, you may want to use {itshape#1}
instead of textit{#1}
, as textit
does not permit paragraph breaks in its scope.– Mico
Jan 20 '15 at 17:34
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
@Mico Good to know, thanks! +1
– wondering
Jan 20 '15 at 20:33
add a comment |
You can gain a finer control of the epigraph and chapter heading by the following package.
begin{filecontents}{chapterhead.sty}
NeedsTeXFormat{LaTeX2e}[2005/12/01]
ProvidesPackage{chapterhead}[2012/07/16 v0.0.1 Chapter head and epigraph (AM)]
RequirePackage{xkeyval}
RequirePackage{catoptions}
new@defchd@alltoendif#1endif{#1}
new@defchd@firsttoendif#1#2endif{#1}
new@def*chdifnumcmpTF#1#2#3{ifnumcmpTF#1#2{#3}}
% chdifchoice can be used to define choice keys via command keys:
new@def*chdifchoice{chdifcaseifstrcmpTF}
new@def*chdifcase#1#2{%
ifstrcmpTF{#1}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#1}endif{}{%
ifstrcmpTF{#2}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#2}endif{}{chd@ifcase{#1}{#2}}%
}%
}%
}%
}
new@def*chd@ifcase#1#2#3{%
ifstrcmpTF{#3}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#3}endif{}{%
#1{#2}{#3}chd@firsttoendif{chd@ifcase@i{#1}{#2}}%
}%
}%
}
new@def*chd@ifcase@i#1#2#3{chd@ifcase{#1}{#2}}
define@cmdkey[DKV]{definekeys}[defkey@]{prefix}[KV]{}
define@cmdkey[DKV]{definekeys}[defkey@]{family}{}
define@cmdkey[DKV]{definekeys}[defkey@]{holder prefix}[mp@]{}
define@boolkey[DKV]{definekeys}[defkey@]{initialize}[true]{}
define@boolkey[DKV]{definekeys}[defkey@]{preset}[true]{}
% Keys not specified in the optional argument of chddefinekeys will
% get default values:
presetkeys[DKV]{definekeys}{prefix,family,holder prefix,
initialize=false,preset=false}{}
robust@def*chddefinekeys{@testoptchd@definekeys{}}
new@def*chd@definekeys[#1]#2{%
setkeys[DKV]{definekeys}{#1}%
defdefkey@defaultlist{}%
edefreserved@a{cptcommanormalize{#2}}%
expandafterdefkey@loopreserved@a,defkey@nil,%
ifboolTF{defkey@preset}{%
cptexpanded{noexpandpresetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}{}%
}%
}{}%
ifboolTF{defkey@initialize}{%
cptexpanded{noexpandsetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}%
}%
}{}%
}
begingroup
lccode`&=1 catcode`&=7
lowercase{endgroup
new@def*chd@rejecttoks{&}%
new@def*defkey@loop#1,{%
defreserved@a{defkey@nil}%
edefreserved@b{cpttrimspace{#1}}%
ifxreserved@areserved@bexpandafter@gobbleelseexpandafter@idenfi
{defkey@splitatslash#1/&/&/&/&/&/&/&/defkey@nildefkey@loop}%
}
}
new@def*chd@cmprejecttoks#1{ifx#1chd@rejecttokselseexpandcsonce#1fi}
new@def*defkey@splitatslash#1/#2/#3/#4/#5/#6/#7/#8/#9defkey@nil{%
edefkeytype{cpttrimspace{#1}}%
edefkeyname{cpttrimspace{#2}}%
edefkeydefault{cpttrimspace{#3}}%
edefkeycode{cpttrimspace{#4}}%
ifxkeynamechd@rejecttoks
@latexerr{Empty key name}@ehd
fi
defreserved@a##1{%
defreserved@a####1##1####2####3@nil{%
defreserved@a{####2}%
}%
reserved@a cmd{0}bool{1}@nil
}%
expandafterreserved@aexpandafter{keytype}%
ifcasereserved@arelax
letreserved@adefine@cmdkey
or
xifinsetTF{,cptoxdetokkeydefault,}{,detokenize{true,false},}{%
letreserved@adefine@boolkey
}{%
@latexerr{Illegal default value 'cptoxdetokkeydefault'
MessageBreak for bool key 'keyname'}@ehd
}%
else
@latexerr{Illegal key type '#1'}@ehd
fi
cptexpanded{noexpandreserved@a
[defkey@prefix]{defkey@family}[usecsn{defkey@holder prefix}]%
{chd@cmprejecttokskeyname}%
ifxkeydefaultchd@rejecttokselse[expandcsoncekeydefault]fi
{chd@cmprejecttokskeycode}%
}%
edefdefkey@defaultlist{%
ifxdefkey@defaultlist@emptyelseexpandcsoncedefkey@defaultlist,fi
keyname
ifxkeydefaultchd@rejecttokselse=%
oifstrcmpTFkeytype{bool}{%
oifstrcmpTFkeydefault{true}{false}{false}%
}{%
expandcsoncekeydefault
}%
fi
}%
}
chddefinekeys[
prefix=CHD,family=epigraf,holder prefix=epg@,initialize,preset
]{%
cmd/width/hsize,
cmd/author/,
cmd/color/black,
cmd/authorcolor/black,
bool/use italics for author/true,
cmd/fontencoding/encodingdefault,
cmd/fontfamily/familydefault,
cmd/fontseries/seriesdefault,
cmd/fontshape/shapedefault,
cmd/fontsize/10pt,
cmd/hskip/0ex,
cmd/prevskip/0ex,
cmd/postvskip/1ex,
bool/frame/true,
}
chddefinekeys[
prefix=CHD,family=chapterhead,holder prefix=chd@,initialize,preset
]{%
cmd/textcolor/black,
cmd/textfontencoding/encodingdefault,
cmd/textfontfamily/familydefault,
cmd/textfontseries/eb,
cmd/textfontshape/shapedefault,
cmd/textfontsize/100pt,
cmd/numberfontencoding/encodingdefault,
cmd/numberfontfamily/familydefault,
cmd/numberfontseries/eb,
cmd/numberfontshape/shapedefault,
cmd/numberfontsize/100pt,
% cmd/leftmargin/leftmargin,
% cmd/rightmargin/rightmargin,
cmd/texthskip/0em,
cmd/textprevskip/0ex,
cmd/textpostvskip/1ex,
cmd/numberprevskip/0ex,
cmd/numberpostvskip/0ex,
cmd/numberhskip/0em,
cmd/numbercolor/black,
cmd/pagestyle/empty,
bool/make text raggedleft/true,
bool/make number raggedleft/true,
bool/print number before text/true,
bool/frame number/true,
bool/no clear page/true
}
newboxchd@boxa
newcommandepigraf[2]{%
setkeys[CHD]{epigraf}{#1}%
setboxchd@boxa=vbox{%
ifepg@framefbox{fi
parboxepg@width{%
fontsize{epg@fontsize}{1.5epg@fontsize}%
usefont{epg@fontencoding}{epg@fontfamily}%
{epg@fontseries}{epg@fontshape}%
ignorespaces
textcolor{epg@color}{#2}%
hspace*{fill}nolinebreak[1]%
quadhspace*{fill}finalhyphendemeritsz@ptrelax
begingroup
ifboolTF{epg@use italics for author}{itshape}{}%
textcolor{epg@authorcolor}{epg@author}%
endgroup
}%
ifepg@frame}fi
}%
globalletchd@printepigrafchd@bprintepigraf
@ignoretrue
}
AtBeginDocument{%
@ifundefined{@mainmattertrue}{newifif@mainmatter@mainmattertrue}{}%
}
new@def*chd@insertchaptertext#1{%
begingroup
ifboolTF{chd@make text raggedleft}{%
raggedleft
}{%
hskipchd@texthskiprelax
}%
advanceleftmargin10em
interlinepenalty@M
vskipchd@textprevskiprelax
fontsize{chd@textfontsize}{1.2chd@textfontsize}%
usefont{chd@textfontencoding}{chd@textfontfamily}%
{chd@textfontseries}{chd@textfontshape}%
textcolor{chd@textcolor}{ignorespaces#1}%
parnobreak
vskipchd@textpostvskiprelax
endgroup
}
new@def*chd@insertchapternumber{%
begingroup
ifnumc@secnumdepth>m@ne
if@mainmatter
vskipchd@numberprevskiprelax
fontsize{chd@numberfontsize}{1.2chd@numberfontsize}%
usefont{chd@numberfontencoding}{chd@numberfontfamily}%
{chd@numberfontseries}{chd@numberfontshape}%
usecsn{ifchd@frame number}fbox{fi
textcolor{chd@numbercolor}{thechapter}%
usecsn{ifchd@frame number}}fi
parnobreak
vskipchd@numberpostvskiprelax
fi
fi
endgroup
}
renewcommandchapter[1]{%
setkeys[CHD]{chapterhead}{#1}%
ifboolTF{chd@no clear page}{}{%
if@openrightcleardoublepageelseclearpagefi
}%
thispagestyle{chd@pagestyle}%
global@topnumz@
ifdefTFchd@printepigrafchd@printepigrafrelax
@afterindentfalse
secdef@chapter@schapter
}
renewcommand{@makechapterhead}[1]{%
begingroup
begingroup
leavevmode
ifboolTF{chd@make number raggedleft}{%
raggedleft
}{%
hskipchd@numberhskiprelax
}%
ifboolTF{chd@print number before text}{%
chd@insertchapternumberchd@insertchaptertext{#1}%
}{%
chd@insertchaptertext{#1}chd@insertchapternumber
}%
endgroup
nobreak
endgroup
}
renewcommand{@makeschapterhead}[1]{%
begingroup
letc@secnumdepthm@ne@makechapterhead{#1}%
endgroup
}
newcommand*chd@bprintepigraf{%
vskipepg@prevskip
hskipepg@hskiprelax
copychd@boxa
vskipepg@postvskip
globalletchd@printepigrafrelax
}
endinput
end{filecontents}
documentclass{book}
usepackage{chapterhead}
usepackage[dvipsnames]{xcolor}
begin{document}
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=blue,
width=.75hsize,
use italics for author=false,
fontsize=8pt,
fontfamily=cmr,
hskip=10em,
postvskip=2ex,
frame,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmbr,
textfontshape=it,% not obtainable because of other choices above
textcolor=red,
make text raggedleft=false,
make number raggedleft=false,
print number before text,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
parvskip3baselineskip
hrule height.5pt depth .4pt relax
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=black,
width=.75hsize,
use italics for author,
fontsize=8pt,
fontfamily=cmr,
hskip=-3em,
prevskip=2ex,
postvskip=2ex,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmss,
textfontshape=it,
textcolor=Brown,
numbercolor=ForestGreen,
make text raggedleft,
make number raggedleft,
frame number,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
end{document}
add a comment |
You can gain a finer control of the epigraph and chapter heading by the following package.
begin{filecontents}{chapterhead.sty}
NeedsTeXFormat{LaTeX2e}[2005/12/01]
ProvidesPackage{chapterhead}[2012/07/16 v0.0.1 Chapter head and epigraph (AM)]
RequirePackage{xkeyval}
RequirePackage{catoptions}
new@defchd@alltoendif#1endif{#1}
new@defchd@firsttoendif#1#2endif{#1}
new@def*chdifnumcmpTF#1#2#3{ifnumcmpTF#1#2{#3}}
% chdifchoice can be used to define choice keys via command keys:
new@def*chdifchoice{chdifcaseifstrcmpTF}
new@def*chdifcase#1#2{%
ifstrcmpTF{#1}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#1}endif{}{%
ifstrcmpTF{#2}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#2}endif{}{chd@ifcase{#1}{#2}}%
}%
}%
}%
}
new@def*chd@ifcase#1#2#3{%
ifstrcmpTF{#3}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#3}endif{}{%
#1{#2}{#3}chd@firsttoendif{chd@ifcase@i{#1}{#2}}%
}%
}%
}
new@def*chd@ifcase@i#1#2#3{chd@ifcase{#1}{#2}}
define@cmdkey[DKV]{definekeys}[defkey@]{prefix}[KV]{}
define@cmdkey[DKV]{definekeys}[defkey@]{family}{}
define@cmdkey[DKV]{definekeys}[defkey@]{holder prefix}[mp@]{}
define@boolkey[DKV]{definekeys}[defkey@]{initialize}[true]{}
define@boolkey[DKV]{definekeys}[defkey@]{preset}[true]{}
% Keys not specified in the optional argument of chddefinekeys will
% get default values:
presetkeys[DKV]{definekeys}{prefix,family,holder prefix,
initialize=false,preset=false}{}
robust@def*chddefinekeys{@testoptchd@definekeys{}}
new@def*chd@definekeys[#1]#2{%
setkeys[DKV]{definekeys}{#1}%
defdefkey@defaultlist{}%
edefreserved@a{cptcommanormalize{#2}}%
expandafterdefkey@loopreserved@a,defkey@nil,%
ifboolTF{defkey@preset}{%
cptexpanded{noexpandpresetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}{}%
}%
}{}%
ifboolTF{defkey@initialize}{%
cptexpanded{noexpandsetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}%
}%
}{}%
}
begingroup
lccode`&=1 catcode`&=7
lowercase{endgroup
new@def*chd@rejecttoks{&}%
new@def*defkey@loop#1,{%
defreserved@a{defkey@nil}%
edefreserved@b{cpttrimspace{#1}}%
ifxreserved@areserved@bexpandafter@gobbleelseexpandafter@idenfi
{defkey@splitatslash#1/&/&/&/&/&/&/&/defkey@nildefkey@loop}%
}
}
new@def*chd@cmprejecttoks#1{ifx#1chd@rejecttokselseexpandcsonce#1fi}
new@def*defkey@splitatslash#1/#2/#3/#4/#5/#6/#7/#8/#9defkey@nil{%
edefkeytype{cpttrimspace{#1}}%
edefkeyname{cpttrimspace{#2}}%
edefkeydefault{cpttrimspace{#3}}%
edefkeycode{cpttrimspace{#4}}%
ifxkeynamechd@rejecttoks
@latexerr{Empty key name}@ehd
fi
defreserved@a##1{%
defreserved@a####1##1####2####3@nil{%
defreserved@a{####2}%
}%
reserved@a cmd{0}bool{1}@nil
}%
expandafterreserved@aexpandafter{keytype}%
ifcasereserved@arelax
letreserved@adefine@cmdkey
or
xifinsetTF{,cptoxdetokkeydefault,}{,detokenize{true,false},}{%
letreserved@adefine@boolkey
}{%
@latexerr{Illegal default value 'cptoxdetokkeydefault'
MessageBreak for bool key 'keyname'}@ehd
}%
else
@latexerr{Illegal key type '#1'}@ehd
fi
cptexpanded{noexpandreserved@a
[defkey@prefix]{defkey@family}[usecsn{defkey@holder prefix}]%
{chd@cmprejecttokskeyname}%
ifxkeydefaultchd@rejecttokselse[expandcsoncekeydefault]fi
{chd@cmprejecttokskeycode}%
}%
edefdefkey@defaultlist{%
ifxdefkey@defaultlist@emptyelseexpandcsoncedefkey@defaultlist,fi
keyname
ifxkeydefaultchd@rejecttokselse=%
oifstrcmpTFkeytype{bool}{%
oifstrcmpTFkeydefault{true}{false}{false}%
}{%
expandcsoncekeydefault
}%
fi
}%
}
chddefinekeys[
prefix=CHD,family=epigraf,holder prefix=epg@,initialize,preset
]{%
cmd/width/hsize,
cmd/author/,
cmd/color/black,
cmd/authorcolor/black,
bool/use italics for author/true,
cmd/fontencoding/encodingdefault,
cmd/fontfamily/familydefault,
cmd/fontseries/seriesdefault,
cmd/fontshape/shapedefault,
cmd/fontsize/10pt,
cmd/hskip/0ex,
cmd/prevskip/0ex,
cmd/postvskip/1ex,
bool/frame/true,
}
chddefinekeys[
prefix=CHD,family=chapterhead,holder prefix=chd@,initialize,preset
]{%
cmd/textcolor/black,
cmd/textfontencoding/encodingdefault,
cmd/textfontfamily/familydefault,
cmd/textfontseries/eb,
cmd/textfontshape/shapedefault,
cmd/textfontsize/100pt,
cmd/numberfontencoding/encodingdefault,
cmd/numberfontfamily/familydefault,
cmd/numberfontseries/eb,
cmd/numberfontshape/shapedefault,
cmd/numberfontsize/100pt,
% cmd/leftmargin/leftmargin,
% cmd/rightmargin/rightmargin,
cmd/texthskip/0em,
cmd/textprevskip/0ex,
cmd/textpostvskip/1ex,
cmd/numberprevskip/0ex,
cmd/numberpostvskip/0ex,
cmd/numberhskip/0em,
cmd/numbercolor/black,
cmd/pagestyle/empty,
bool/make text raggedleft/true,
bool/make number raggedleft/true,
bool/print number before text/true,
bool/frame number/true,
bool/no clear page/true
}
newboxchd@boxa
newcommandepigraf[2]{%
setkeys[CHD]{epigraf}{#1}%
setboxchd@boxa=vbox{%
ifepg@framefbox{fi
parboxepg@width{%
fontsize{epg@fontsize}{1.5epg@fontsize}%
usefont{epg@fontencoding}{epg@fontfamily}%
{epg@fontseries}{epg@fontshape}%
ignorespaces
textcolor{epg@color}{#2}%
hspace*{fill}nolinebreak[1]%
quadhspace*{fill}finalhyphendemeritsz@ptrelax
begingroup
ifboolTF{epg@use italics for author}{itshape}{}%
textcolor{epg@authorcolor}{epg@author}%
endgroup
}%
ifepg@frame}fi
}%
globalletchd@printepigrafchd@bprintepigraf
@ignoretrue
}
AtBeginDocument{%
@ifundefined{@mainmattertrue}{newifif@mainmatter@mainmattertrue}{}%
}
new@def*chd@insertchaptertext#1{%
begingroup
ifboolTF{chd@make text raggedleft}{%
raggedleft
}{%
hskipchd@texthskiprelax
}%
advanceleftmargin10em
interlinepenalty@M
vskipchd@textprevskiprelax
fontsize{chd@textfontsize}{1.2chd@textfontsize}%
usefont{chd@textfontencoding}{chd@textfontfamily}%
{chd@textfontseries}{chd@textfontshape}%
textcolor{chd@textcolor}{ignorespaces#1}%
parnobreak
vskipchd@textpostvskiprelax
endgroup
}
new@def*chd@insertchapternumber{%
begingroup
ifnumc@secnumdepth>m@ne
if@mainmatter
vskipchd@numberprevskiprelax
fontsize{chd@numberfontsize}{1.2chd@numberfontsize}%
usefont{chd@numberfontencoding}{chd@numberfontfamily}%
{chd@numberfontseries}{chd@numberfontshape}%
usecsn{ifchd@frame number}fbox{fi
textcolor{chd@numbercolor}{thechapter}%
usecsn{ifchd@frame number}}fi
parnobreak
vskipchd@numberpostvskiprelax
fi
fi
endgroup
}
renewcommandchapter[1]{%
setkeys[CHD]{chapterhead}{#1}%
ifboolTF{chd@no clear page}{}{%
if@openrightcleardoublepageelseclearpagefi
}%
thispagestyle{chd@pagestyle}%
global@topnumz@
ifdefTFchd@printepigrafchd@printepigrafrelax
@afterindentfalse
secdef@chapter@schapter
}
renewcommand{@makechapterhead}[1]{%
begingroup
begingroup
leavevmode
ifboolTF{chd@make number raggedleft}{%
raggedleft
}{%
hskipchd@numberhskiprelax
}%
ifboolTF{chd@print number before text}{%
chd@insertchapternumberchd@insertchaptertext{#1}%
}{%
chd@insertchaptertext{#1}chd@insertchapternumber
}%
endgroup
nobreak
endgroup
}
renewcommand{@makeschapterhead}[1]{%
begingroup
letc@secnumdepthm@ne@makechapterhead{#1}%
endgroup
}
newcommand*chd@bprintepigraf{%
vskipepg@prevskip
hskipepg@hskiprelax
copychd@boxa
vskipepg@postvskip
globalletchd@printepigrafrelax
}
endinput
end{filecontents}
documentclass{book}
usepackage{chapterhead}
usepackage[dvipsnames]{xcolor}
begin{document}
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=blue,
width=.75hsize,
use italics for author=false,
fontsize=8pt,
fontfamily=cmr,
hskip=10em,
postvskip=2ex,
frame,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmbr,
textfontshape=it,% not obtainable because of other choices above
textcolor=red,
make text raggedleft=false,
make number raggedleft=false,
print number before text,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
parvskip3baselineskip
hrule height.5pt depth .4pt relax
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=black,
width=.75hsize,
use italics for author,
fontsize=8pt,
fontfamily=cmr,
hskip=-3em,
prevskip=2ex,
postvskip=2ex,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmss,
textfontshape=it,
textcolor=Brown,
numbercolor=ForestGreen,
make text raggedleft,
make number raggedleft,
frame number,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
end{document}
add a comment |
You can gain a finer control of the epigraph and chapter heading by the following package.
begin{filecontents}{chapterhead.sty}
NeedsTeXFormat{LaTeX2e}[2005/12/01]
ProvidesPackage{chapterhead}[2012/07/16 v0.0.1 Chapter head and epigraph (AM)]
RequirePackage{xkeyval}
RequirePackage{catoptions}
new@defchd@alltoendif#1endif{#1}
new@defchd@firsttoendif#1#2endif{#1}
new@def*chdifnumcmpTF#1#2#3{ifnumcmpTF#1#2{#3}}
% chdifchoice can be used to define choice keys via command keys:
new@def*chdifchoice{chdifcaseifstrcmpTF}
new@def*chdifcase#1#2{%
ifstrcmpTF{#1}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#1}endif{}{%
ifstrcmpTF{#2}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#2}endif{}{chd@ifcase{#1}{#2}}%
}%
}%
}%
}
new@def*chd@ifcase#1#2#3{%
ifstrcmpTF{#3}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#3}endif{}{%
#1{#2}{#3}chd@firsttoendif{chd@ifcase@i{#1}{#2}}%
}%
}%
}
new@def*chd@ifcase@i#1#2#3{chd@ifcase{#1}{#2}}
define@cmdkey[DKV]{definekeys}[defkey@]{prefix}[KV]{}
define@cmdkey[DKV]{definekeys}[defkey@]{family}{}
define@cmdkey[DKV]{definekeys}[defkey@]{holder prefix}[mp@]{}
define@boolkey[DKV]{definekeys}[defkey@]{initialize}[true]{}
define@boolkey[DKV]{definekeys}[defkey@]{preset}[true]{}
% Keys not specified in the optional argument of chddefinekeys will
% get default values:
presetkeys[DKV]{definekeys}{prefix,family,holder prefix,
initialize=false,preset=false}{}
robust@def*chddefinekeys{@testoptchd@definekeys{}}
new@def*chd@definekeys[#1]#2{%
setkeys[DKV]{definekeys}{#1}%
defdefkey@defaultlist{}%
edefreserved@a{cptcommanormalize{#2}}%
expandafterdefkey@loopreserved@a,defkey@nil,%
ifboolTF{defkey@preset}{%
cptexpanded{noexpandpresetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}{}%
}%
}{}%
ifboolTF{defkey@initialize}{%
cptexpanded{noexpandsetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}%
}%
}{}%
}
begingroup
lccode`&=1 catcode`&=7
lowercase{endgroup
new@def*chd@rejecttoks{&}%
new@def*defkey@loop#1,{%
defreserved@a{defkey@nil}%
edefreserved@b{cpttrimspace{#1}}%
ifxreserved@areserved@bexpandafter@gobbleelseexpandafter@idenfi
{defkey@splitatslash#1/&/&/&/&/&/&/&/defkey@nildefkey@loop}%
}
}
new@def*chd@cmprejecttoks#1{ifx#1chd@rejecttokselseexpandcsonce#1fi}
new@def*defkey@splitatslash#1/#2/#3/#4/#5/#6/#7/#8/#9defkey@nil{%
edefkeytype{cpttrimspace{#1}}%
edefkeyname{cpttrimspace{#2}}%
edefkeydefault{cpttrimspace{#3}}%
edefkeycode{cpttrimspace{#4}}%
ifxkeynamechd@rejecttoks
@latexerr{Empty key name}@ehd
fi
defreserved@a##1{%
defreserved@a####1##1####2####3@nil{%
defreserved@a{####2}%
}%
reserved@a cmd{0}bool{1}@nil
}%
expandafterreserved@aexpandafter{keytype}%
ifcasereserved@arelax
letreserved@adefine@cmdkey
or
xifinsetTF{,cptoxdetokkeydefault,}{,detokenize{true,false},}{%
letreserved@adefine@boolkey
}{%
@latexerr{Illegal default value 'cptoxdetokkeydefault'
MessageBreak for bool key 'keyname'}@ehd
}%
else
@latexerr{Illegal key type '#1'}@ehd
fi
cptexpanded{noexpandreserved@a
[defkey@prefix]{defkey@family}[usecsn{defkey@holder prefix}]%
{chd@cmprejecttokskeyname}%
ifxkeydefaultchd@rejecttokselse[expandcsoncekeydefault]fi
{chd@cmprejecttokskeycode}%
}%
edefdefkey@defaultlist{%
ifxdefkey@defaultlist@emptyelseexpandcsoncedefkey@defaultlist,fi
keyname
ifxkeydefaultchd@rejecttokselse=%
oifstrcmpTFkeytype{bool}{%
oifstrcmpTFkeydefault{true}{false}{false}%
}{%
expandcsoncekeydefault
}%
fi
}%
}
chddefinekeys[
prefix=CHD,family=epigraf,holder prefix=epg@,initialize,preset
]{%
cmd/width/hsize,
cmd/author/,
cmd/color/black,
cmd/authorcolor/black,
bool/use italics for author/true,
cmd/fontencoding/encodingdefault,
cmd/fontfamily/familydefault,
cmd/fontseries/seriesdefault,
cmd/fontshape/shapedefault,
cmd/fontsize/10pt,
cmd/hskip/0ex,
cmd/prevskip/0ex,
cmd/postvskip/1ex,
bool/frame/true,
}
chddefinekeys[
prefix=CHD,family=chapterhead,holder prefix=chd@,initialize,preset
]{%
cmd/textcolor/black,
cmd/textfontencoding/encodingdefault,
cmd/textfontfamily/familydefault,
cmd/textfontseries/eb,
cmd/textfontshape/shapedefault,
cmd/textfontsize/100pt,
cmd/numberfontencoding/encodingdefault,
cmd/numberfontfamily/familydefault,
cmd/numberfontseries/eb,
cmd/numberfontshape/shapedefault,
cmd/numberfontsize/100pt,
% cmd/leftmargin/leftmargin,
% cmd/rightmargin/rightmargin,
cmd/texthskip/0em,
cmd/textprevskip/0ex,
cmd/textpostvskip/1ex,
cmd/numberprevskip/0ex,
cmd/numberpostvskip/0ex,
cmd/numberhskip/0em,
cmd/numbercolor/black,
cmd/pagestyle/empty,
bool/make text raggedleft/true,
bool/make number raggedleft/true,
bool/print number before text/true,
bool/frame number/true,
bool/no clear page/true
}
newboxchd@boxa
newcommandepigraf[2]{%
setkeys[CHD]{epigraf}{#1}%
setboxchd@boxa=vbox{%
ifepg@framefbox{fi
parboxepg@width{%
fontsize{epg@fontsize}{1.5epg@fontsize}%
usefont{epg@fontencoding}{epg@fontfamily}%
{epg@fontseries}{epg@fontshape}%
ignorespaces
textcolor{epg@color}{#2}%
hspace*{fill}nolinebreak[1]%
quadhspace*{fill}finalhyphendemeritsz@ptrelax
begingroup
ifboolTF{epg@use italics for author}{itshape}{}%
textcolor{epg@authorcolor}{epg@author}%
endgroup
}%
ifepg@frame}fi
}%
globalletchd@printepigrafchd@bprintepigraf
@ignoretrue
}
AtBeginDocument{%
@ifundefined{@mainmattertrue}{newifif@mainmatter@mainmattertrue}{}%
}
new@def*chd@insertchaptertext#1{%
begingroup
ifboolTF{chd@make text raggedleft}{%
raggedleft
}{%
hskipchd@texthskiprelax
}%
advanceleftmargin10em
interlinepenalty@M
vskipchd@textprevskiprelax
fontsize{chd@textfontsize}{1.2chd@textfontsize}%
usefont{chd@textfontencoding}{chd@textfontfamily}%
{chd@textfontseries}{chd@textfontshape}%
textcolor{chd@textcolor}{ignorespaces#1}%
parnobreak
vskipchd@textpostvskiprelax
endgroup
}
new@def*chd@insertchapternumber{%
begingroup
ifnumc@secnumdepth>m@ne
if@mainmatter
vskipchd@numberprevskiprelax
fontsize{chd@numberfontsize}{1.2chd@numberfontsize}%
usefont{chd@numberfontencoding}{chd@numberfontfamily}%
{chd@numberfontseries}{chd@numberfontshape}%
usecsn{ifchd@frame number}fbox{fi
textcolor{chd@numbercolor}{thechapter}%
usecsn{ifchd@frame number}}fi
parnobreak
vskipchd@numberpostvskiprelax
fi
fi
endgroup
}
renewcommandchapter[1]{%
setkeys[CHD]{chapterhead}{#1}%
ifboolTF{chd@no clear page}{}{%
if@openrightcleardoublepageelseclearpagefi
}%
thispagestyle{chd@pagestyle}%
global@topnumz@
ifdefTFchd@printepigrafchd@printepigrafrelax
@afterindentfalse
secdef@chapter@schapter
}
renewcommand{@makechapterhead}[1]{%
begingroup
begingroup
leavevmode
ifboolTF{chd@make number raggedleft}{%
raggedleft
}{%
hskipchd@numberhskiprelax
}%
ifboolTF{chd@print number before text}{%
chd@insertchapternumberchd@insertchaptertext{#1}%
}{%
chd@insertchaptertext{#1}chd@insertchapternumber
}%
endgroup
nobreak
endgroup
}
renewcommand{@makeschapterhead}[1]{%
begingroup
letc@secnumdepthm@ne@makechapterhead{#1}%
endgroup
}
newcommand*chd@bprintepigraf{%
vskipepg@prevskip
hskipepg@hskiprelax
copychd@boxa
vskipepg@postvskip
globalletchd@printepigrafrelax
}
endinput
end{filecontents}
documentclass{book}
usepackage{chapterhead}
usepackage[dvipsnames]{xcolor}
begin{document}
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=blue,
width=.75hsize,
use italics for author=false,
fontsize=8pt,
fontfamily=cmr,
hskip=10em,
postvskip=2ex,
frame,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmbr,
textfontshape=it,% not obtainable because of other choices above
textcolor=red,
make text raggedleft=false,
make number raggedleft=false,
print number before text,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
parvskip3baselineskip
hrule height.5pt depth .4pt relax
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=black,
width=.75hsize,
use italics for author,
fontsize=8pt,
fontfamily=cmr,
hskip=-3em,
prevskip=2ex,
postvskip=2ex,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmss,
textfontshape=it,
textcolor=Brown,
numbercolor=ForestGreen,
make text raggedleft,
make number raggedleft,
frame number,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
end{document}
You can gain a finer control of the epigraph and chapter heading by the following package.
begin{filecontents}{chapterhead.sty}
NeedsTeXFormat{LaTeX2e}[2005/12/01]
ProvidesPackage{chapterhead}[2012/07/16 v0.0.1 Chapter head and epigraph (AM)]
RequirePackage{xkeyval}
RequirePackage{catoptions}
new@defchd@alltoendif#1endif{#1}
new@defchd@firsttoendif#1#2endif{#1}
new@def*chdifnumcmpTF#1#2#3{ifnumcmpTF#1#2{#3}}
% chdifchoice can be used to define choice keys via command keys:
new@def*chdifchoice{chdifcaseifstrcmpTF}
new@def*chdifcase#1#2{%
ifstrcmpTF{#1}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#1}endif{}{%
ifstrcmpTF{#2}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#2}endif{}{chd@ifcase{#1}{#2}}%
}%
}%
}%
}
new@def*chd@ifcase#1#2#3{%
ifstrcmpTF{#3}ifnone{%
chd@alltoendif
}{%
ifstrcmpTF{#3}endif{}{%
#1{#2}{#3}chd@firsttoendif{chd@ifcase@i{#1}{#2}}%
}%
}%
}
new@def*chd@ifcase@i#1#2#3{chd@ifcase{#1}{#2}}
define@cmdkey[DKV]{definekeys}[defkey@]{prefix}[KV]{}
define@cmdkey[DKV]{definekeys}[defkey@]{family}{}
define@cmdkey[DKV]{definekeys}[defkey@]{holder prefix}[mp@]{}
define@boolkey[DKV]{definekeys}[defkey@]{initialize}[true]{}
define@boolkey[DKV]{definekeys}[defkey@]{preset}[true]{}
% Keys not specified in the optional argument of chddefinekeys will
% get default values:
presetkeys[DKV]{definekeys}{prefix,family,holder prefix,
initialize=false,preset=false}{}
robust@def*chddefinekeys{@testoptchd@definekeys{}}
new@def*chd@definekeys[#1]#2{%
setkeys[DKV]{definekeys}{#1}%
defdefkey@defaultlist{}%
edefreserved@a{cptcommanormalize{#2}}%
expandafterdefkey@loopreserved@a,defkey@nil,%
ifboolTF{defkey@preset}{%
cptexpanded{noexpandpresetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}{}%
}%
}{}%
ifboolTF{defkey@initialize}{%
cptexpanded{noexpandsetkeys
[defkey@prefix]{defkey@family}{expandcsoncedefkey@defaultlist}%
}%
}{}%
}
begingroup
lccode`&=1 catcode`&=7
lowercase{endgroup
new@def*chd@rejecttoks{&}%
new@def*defkey@loop#1,{%
defreserved@a{defkey@nil}%
edefreserved@b{cpttrimspace{#1}}%
ifxreserved@areserved@bexpandafter@gobbleelseexpandafter@idenfi
{defkey@splitatslash#1/&/&/&/&/&/&/&/defkey@nildefkey@loop}%
}
}
new@def*chd@cmprejecttoks#1{ifx#1chd@rejecttokselseexpandcsonce#1fi}
new@def*defkey@splitatslash#1/#2/#3/#4/#5/#6/#7/#8/#9defkey@nil{%
edefkeytype{cpttrimspace{#1}}%
edefkeyname{cpttrimspace{#2}}%
edefkeydefault{cpttrimspace{#3}}%
edefkeycode{cpttrimspace{#4}}%
ifxkeynamechd@rejecttoks
@latexerr{Empty key name}@ehd
fi
defreserved@a##1{%
defreserved@a####1##1####2####3@nil{%
defreserved@a{####2}%
}%
reserved@a cmd{0}bool{1}@nil
}%
expandafterreserved@aexpandafter{keytype}%
ifcasereserved@arelax
letreserved@adefine@cmdkey
or
xifinsetTF{,cptoxdetokkeydefault,}{,detokenize{true,false},}{%
letreserved@adefine@boolkey
}{%
@latexerr{Illegal default value 'cptoxdetokkeydefault'
MessageBreak for bool key 'keyname'}@ehd
}%
else
@latexerr{Illegal key type '#1'}@ehd
fi
cptexpanded{noexpandreserved@a
[defkey@prefix]{defkey@family}[usecsn{defkey@holder prefix}]%
{chd@cmprejecttokskeyname}%
ifxkeydefaultchd@rejecttokselse[expandcsoncekeydefault]fi
{chd@cmprejecttokskeycode}%
}%
edefdefkey@defaultlist{%
ifxdefkey@defaultlist@emptyelseexpandcsoncedefkey@defaultlist,fi
keyname
ifxkeydefaultchd@rejecttokselse=%
oifstrcmpTFkeytype{bool}{%
oifstrcmpTFkeydefault{true}{false}{false}%
}{%
expandcsoncekeydefault
}%
fi
}%
}
chddefinekeys[
prefix=CHD,family=epigraf,holder prefix=epg@,initialize,preset
]{%
cmd/width/hsize,
cmd/author/,
cmd/color/black,
cmd/authorcolor/black,
bool/use italics for author/true,
cmd/fontencoding/encodingdefault,
cmd/fontfamily/familydefault,
cmd/fontseries/seriesdefault,
cmd/fontshape/shapedefault,
cmd/fontsize/10pt,
cmd/hskip/0ex,
cmd/prevskip/0ex,
cmd/postvskip/1ex,
bool/frame/true,
}
chddefinekeys[
prefix=CHD,family=chapterhead,holder prefix=chd@,initialize,preset
]{%
cmd/textcolor/black,
cmd/textfontencoding/encodingdefault,
cmd/textfontfamily/familydefault,
cmd/textfontseries/eb,
cmd/textfontshape/shapedefault,
cmd/textfontsize/100pt,
cmd/numberfontencoding/encodingdefault,
cmd/numberfontfamily/familydefault,
cmd/numberfontseries/eb,
cmd/numberfontshape/shapedefault,
cmd/numberfontsize/100pt,
% cmd/leftmargin/leftmargin,
% cmd/rightmargin/rightmargin,
cmd/texthskip/0em,
cmd/textprevskip/0ex,
cmd/textpostvskip/1ex,
cmd/numberprevskip/0ex,
cmd/numberpostvskip/0ex,
cmd/numberhskip/0em,
cmd/numbercolor/black,
cmd/pagestyle/empty,
bool/make text raggedleft/true,
bool/make number raggedleft/true,
bool/print number before text/true,
bool/frame number/true,
bool/no clear page/true
}
newboxchd@boxa
newcommandepigraf[2]{%
setkeys[CHD]{epigraf}{#1}%
setboxchd@boxa=vbox{%
ifepg@framefbox{fi
parboxepg@width{%
fontsize{epg@fontsize}{1.5epg@fontsize}%
usefont{epg@fontencoding}{epg@fontfamily}%
{epg@fontseries}{epg@fontshape}%
ignorespaces
textcolor{epg@color}{#2}%
hspace*{fill}nolinebreak[1]%
quadhspace*{fill}finalhyphendemeritsz@ptrelax
begingroup
ifboolTF{epg@use italics for author}{itshape}{}%
textcolor{epg@authorcolor}{epg@author}%
endgroup
}%
ifepg@frame}fi
}%
globalletchd@printepigrafchd@bprintepigraf
@ignoretrue
}
AtBeginDocument{%
@ifundefined{@mainmattertrue}{newifif@mainmatter@mainmattertrue}{}%
}
new@def*chd@insertchaptertext#1{%
begingroup
ifboolTF{chd@make text raggedleft}{%
raggedleft
}{%
hskipchd@texthskiprelax
}%
advanceleftmargin10em
interlinepenalty@M
vskipchd@textprevskiprelax
fontsize{chd@textfontsize}{1.2chd@textfontsize}%
usefont{chd@textfontencoding}{chd@textfontfamily}%
{chd@textfontseries}{chd@textfontshape}%
textcolor{chd@textcolor}{ignorespaces#1}%
parnobreak
vskipchd@textpostvskiprelax
endgroup
}
new@def*chd@insertchapternumber{%
begingroup
ifnumc@secnumdepth>m@ne
if@mainmatter
vskipchd@numberprevskiprelax
fontsize{chd@numberfontsize}{1.2chd@numberfontsize}%
usefont{chd@numberfontencoding}{chd@numberfontfamily}%
{chd@numberfontseries}{chd@numberfontshape}%
usecsn{ifchd@frame number}fbox{fi
textcolor{chd@numbercolor}{thechapter}%
usecsn{ifchd@frame number}}fi
parnobreak
vskipchd@numberpostvskiprelax
fi
fi
endgroup
}
renewcommandchapter[1]{%
setkeys[CHD]{chapterhead}{#1}%
ifboolTF{chd@no clear page}{}{%
if@openrightcleardoublepageelseclearpagefi
}%
thispagestyle{chd@pagestyle}%
global@topnumz@
ifdefTFchd@printepigrafchd@printepigrafrelax
@afterindentfalse
secdef@chapter@schapter
}
renewcommand{@makechapterhead}[1]{%
begingroup
begingroup
leavevmode
ifboolTF{chd@make number raggedleft}{%
raggedleft
}{%
hskipchd@numberhskiprelax
}%
ifboolTF{chd@print number before text}{%
chd@insertchapternumberchd@insertchaptertext{#1}%
}{%
chd@insertchaptertext{#1}chd@insertchapternumber
}%
endgroup
nobreak
endgroup
}
renewcommand{@makeschapterhead}[1]{%
begingroup
letc@secnumdepthm@ne@makechapterhead{#1}%
endgroup
}
newcommand*chd@bprintepigraf{%
vskipepg@prevskip
hskipepg@hskiprelax
copychd@boxa
vskipepg@postvskip
globalletchd@printepigrafrelax
}
endinput
end{filecontents}
documentclass{book}
usepackage{chapterhead}
usepackage[dvipsnames]{xcolor}
begin{document}
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=blue,
width=.75hsize,
use italics for author=false,
fontsize=8pt,
fontfamily=cmr,
hskip=10em,
postvskip=2ex,
frame,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmbr,
textfontshape=it,% not obtainable because of other choices above
textcolor=red,
make text raggedleft=false,
make number raggedleft=false,
print number before text,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
parvskip3baselineskip
hrule height.5pt depth .4pt relax
epigraf[
author={Lewis Carroll, textit{Alice in Wonderland}},
color=black,
width=.75hsize,
use italics for author,
fontsize=8pt,
fontfamily=cmr,
hskip=-3em,
prevskip=2ex,
postvskip=2ex,
]{
``Begin at the beginning,'' the King said, gravely, ``and go on till you
come to an end; then stop.''
}
chapter[
numberpostvskip=.2ex,
numberfontseries=ux,
numberfontfamily=cmbr,
textfontseries=ex,
textfontsize=50pt,
textfontfamily=cmss,
textfontshape=it,
textcolor=Brown,
numbercolor=ForestGreen,
make text raggedleft,
make number raggedleft,
frame number,
no clear page
]{Graph Theory}
noindent The Pregolya River passes through the city once known as K"onigsberg.
In the 1700s seven bridges were situated across this river in a manner similar
to what you see in Figure ldots
end{document}
edited Jul 16 '12 at 15:40
answered Jul 16 '12 at 6:48
Ahmed Musa
9,10912053
9,10912053
add a comment |
add a comment |
edit: on second look, my answer is highly similar to wondering's answer
I wanted to do something similar, and came up with a simple and (imo) clean way of reproducing the style of the OP;
documentclass{book}
begin{document}
chapter{Inspirational Quote}
begin{flushright}
rightskip=1.8cmtextit{``Dis-moi ce que tu manges, je te dirai ce que tu es.''} \
vspace{.2em}
rightskip=.8cm---Jean Anthelme Brillat-Savarin
end{flushright}
vspace{1em}
noindent
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{document}
(the additional rightskip
s + vspace
s are just for prettiness sake).
Which results in:
Unless you changedbook.cls
your code does not produce the outcome your picture shows.
– clemens
Sep 21 '16 at 11:39
add a comment |
edit: on second look, my answer is highly similar to wondering's answer
I wanted to do something similar, and came up with a simple and (imo) clean way of reproducing the style of the OP;
documentclass{book}
begin{document}
chapter{Inspirational Quote}
begin{flushright}
rightskip=1.8cmtextit{``Dis-moi ce que tu manges, je te dirai ce que tu es.''} \
vspace{.2em}
rightskip=.8cm---Jean Anthelme Brillat-Savarin
end{flushright}
vspace{1em}
noindent
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{document}
(the additional rightskip
s + vspace
s are just for prettiness sake).
Which results in:
Unless you changedbook.cls
your code does not produce the outcome your picture shows.
– clemens
Sep 21 '16 at 11:39
add a comment |
edit: on second look, my answer is highly similar to wondering's answer
I wanted to do something similar, and came up with a simple and (imo) clean way of reproducing the style of the OP;
documentclass{book}
begin{document}
chapter{Inspirational Quote}
begin{flushright}
rightskip=1.8cmtextit{``Dis-moi ce que tu manges, je te dirai ce que tu es.''} \
vspace{.2em}
rightskip=.8cm---Jean Anthelme Brillat-Savarin
end{flushright}
vspace{1em}
noindent
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{document}
(the additional rightskip
s + vspace
s are just for prettiness sake).
Which results in:
edit: on second look, my answer is highly similar to wondering's answer
I wanted to do something similar, and came up with a simple and (imo) clean way of reproducing the style of the OP;
documentclass{book}
begin{document}
chapter{Inspirational Quote}
begin{flushright}
rightskip=1.8cmtextit{``Dis-moi ce que tu manges, je te dirai ce que tu es.''} \
vspace{.2em}
rightskip=.8cm---Jean Anthelme Brillat-Savarin
end{flushright}
vspace{1em}
noindent
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
end{document}
(the additional rightskip
s + vspace
s are just for prettiness sake).
Which results in:
edited Apr 13 '17 at 12:34
Community♦
1
1
answered Sep 19 '16 at 15:15
graus
113
113
Unless you changedbook.cls
your code does not produce the outcome your picture shows.
– clemens
Sep 21 '16 at 11:39
add a comment |
Unless you changedbook.cls
your code does not produce the outcome your picture shows.
– clemens
Sep 21 '16 at 11:39
Unless you changed
book.cls
your code does not produce the outcome your picture shows.– clemens
Sep 21 '16 at 11:39
Unless you changed
book.cls
your code does not produce the outcome your picture shows.– clemens
Sep 21 '16 at 11:39
add a comment |
There is a package called "dirtytalk". Here is the code snippet:
chapter{Graph Theory}
say{textit{Beginning at the beginning,}} textit{the King said gravely,}
say{textit{and go on till you come to the end; then stop.}} --- textit{Lewis Carroll, Alice in Wonderland}
add a comment |
There is a package called "dirtytalk". Here is the code snippet:
chapter{Graph Theory}
say{textit{Beginning at the beginning,}} textit{the King said gravely,}
say{textit{and go on till you come to the end; then stop.}} --- textit{Lewis Carroll, Alice in Wonderland}
add a comment |
There is a package called "dirtytalk". Here is the code snippet:
chapter{Graph Theory}
say{textit{Beginning at the beginning,}} textit{the King said gravely,}
say{textit{and go on till you come to the end; then stop.}} --- textit{Lewis Carroll, Alice in Wonderland}
There is a package called "dirtytalk". Here is the code snippet:
chapter{Graph Theory}
say{textit{Beginning at the beginning,}} textit{the King said gravely,}
say{textit{and go on till you come to the end; then stop.}} --- textit{Lewis Carroll, Alice in Wonderland}
answered Jun 4 '16 at 18:15
Srinidhi
1
1
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f53377%2finspirational-quote-at-start-of-chapter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How to do just the beautiful quote in the first picture example by redefining newenvironment{quote} and also by defining my own myQuote{<quote>}{<my whom>} in documentclass{article}?
– user16637
Jul 15 '12 at 18:23
7
That is an awesome quote.
– Jason
Oct 20 '13 at 17:36