Packtpub
Packtpub
December 6, 2018
Contents
1 Format of chapters 5
1.1 Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.1 Chapter Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.2 Section Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.3 Subsection Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Page Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Improvements 9
2.1 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 Numbered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.2 Bulleted lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Verses and Citations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.1 Poetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.2 Citacions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 Minisec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 Show 19
3.1 Fourth section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1.1 First subsection of the fourth section . . . . . . . . . . . . . . . . 21
3.1.2 Second subsection of the fourth section . . . . . . . . . . . . . . 22
—3—
1
Format of chapters
Find an interesting quote, . . .
(Timothy K. Paine)
This entry, which is located on the right side of the page, is called Sentence and is
obtained with the command \dictum[author]{text}.
1.1 Titles
The package titlesec has been used to finish formatting section headings. The
command that allows us to do so is:
\titleformat{command}[shape]%
{format}%
{label}%
{sep}% horizontal separation between label and body of the title
{before}[after]% precedent / next code in the title body
—5—
1 Format of chapters
The chapters begin with the number and the name in gray letter, which is obtained
with the command:
The font is Helvetica and of different size, the number (\numcap) of 3 cm and the
text (\textcap) of 1.5 cm, format that is obtained with the initial definition:
The package titlesec has been used to finish formatting section headings. Specif-
ically for the chapters is defined:
\titleformat{\chapter}[display]%
{\usekomafont{sectioning} \usekomafont{chapter}\filleft}%
%Formatted according to definitions of KOMA and aligns right
{\numcap\textcolor[named]{gray}\thechapter}%
% format the color capitol number
{1em}%
{}
Section headings have the white text on a color background, the color is obtained
with the command:
\addtokomafont{section}{\color{white}}
and the color of black background is achieved with the mentioned package
titlesec and the use of a background image generated by the package
\titleformat{\section}[block]%
{\usekomafont{sectioning}\usekomafont{section}%
\tikz[overlay] \fill[color=black,rounded corners=.2ex] (0,-1ex) rectangle (\textwidth-2cm,1em);}%
{ \thesection}%
{1em}%
{}
6
1.2 Page Style
The subsection titles have the white text on a color background, the color of the
text, as in the case of the sections, is obtained with the command:
\addtokomafont{subsection}{\color{white}}
and the black background color is achieved with the package titlesec and the use
of a background image generated by the package \tikz:
\titleformat{\subsection}[block]%
{\usekomafont{sectioning}\usekomafont{subsection}%
\tikz[overlay] \fill[color=black!60] (0,-1ex) rectangle (\textwidth-2cm,1em);}%
{\thesubsection}%
{1em}%
{}
The pages use the style scrheadings defined by KOMA and customized so that:
I The heading consists of the chapter name on the left page and section on the
right page, with a small black sans serif underlined with a gray line that goes
beyond the width of the text.
I The foot consists of the centered page number and in a gray box that stands
above a gray line that goes from side to side of the text.
This is achieved by using the scrpage2 package of the KOMA set, where it is de-
fined:
\setlength{\headheight}{25pt}
\pagestyle{scrheadings} % page style
\setheadwidth{textwithmarginpar} % lengthens the header
\setheadsepline{.4pt} %line under the header
\addtokomafont{headsepline}{\color{lightgray}}% gives gray line under header
%left page footer:
\lefoot{\color{black!40}{\hrulefill}}
\cefoot{\parbox[c][.5in][c]{1cm}{\fcolorbox{black!40}{white}{\thepage}}}
\refoot{}
\lofoot{\color{black!40}{\hrulefill}}
\cofoot[{\color{black!40}{---}} {\thepage} {\color{black!40}{---}}]%
{\parbox[c][.5in][c]{1cm}{\fcolorbox{black!40}{white}{\thepage}}}
\rofoot[]{}
Chapter start pages, in style plain, are defined in the preceding com-
mands as the option of the corresponding command, for example:
\cfoot[style scrplain ]{style scrheadings}
7
2
Improvements
Different packages have been used to achieve improvements in different aspects
of the body of the text. For example, for the lists the package enumerate, for the
tables the package colortbl or the package bclogo for the calls, whose details will
be seen in the next sections.
2.1 Lists
With the package enumitem we can define new styles of lists with the command:
—9—
2 Improvements
2.1.1.1 Steps
It is a compact list numbered in the scheme (1. - 1.1 - 1.1.1) indented to the left 0.5
cm to indicate steps. The code to get it is:
\newlist{steps}{enumerate}{4}
\setlist[steps]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[steps,1]{label*=\arabic*.}
\setlist[steps,2]{label*=\arabic*.}
\setlist[steps,3]{label*=\arabic*.}
\setlist[steps,4]{label*=\arabic*.}
1. first
2. second
3. third
4. fourth
5. fifth
6. sixth
7. seventh
This list uses predefined numbers in the package pifont and which are quite in-
teresting. However it can not be defined with the \newlist command and the code
must be indicated each time it is used in the body of the text.
\begin{enumerate}[nolistsep,label=\ding{\value{enumi}},start=202]
where 202 is the character code of the package pifont. See the result:
¬ first
second
® third
¯ fourth
10
2.1 Lists
° fifth
± sixth
² seventh
³ eigth
´ ninth
µ tenth
¶ first
· second
¸ third
¹ fourth
º fifth
» sixth
¼ seventh
½ eigth
¾ ninth
¿ tenth
Ê first
Ë second
Ì third
Í fourth
Î fifth
Ï sixth
Ð seventh
Ñ eigth
Ò ninth
Ó tenth
2.1.2.1 Objectives
11
2 Improvements
\newlist{objectives}{itemize}{1}
\setlist[objectives]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[objectives,1]{label=\tiny$\blacktriangleright$}
I first objective
I second objective
I third objective
I fourth objective
2.1.2.2 Attention
\newlist{atencio}{itemize}{1}
\setlist[atencio]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[atencio,1]{label=\ding{224}}
à first point
à second point
à third point
à fourth point
2.1.2.3 Points
\newlist{points}{itemize}{4}
\setlist[points]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[points,1]{label=\tiny\ding{110}}
\setlist[points,2]{label=\tiny\ding{108}}
\setlist[points,3]{label=\tiny\ding{72}}
\setlist[points,4]{label=\tiny\ding{117}}
12
2.1 Lists
n flying devices
l biplanes
l jets
l of transport
H of a single engine
u to reaction
u to helix
H different motors
l helicopters
n automobiles
l racing cars
l private cars
l trucks
n bicycles
2.1.2.4 Arrows
\newlist{arrows}{itemize}{4}
\setlist[arrows]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0.5cm,leftmargin=*}
\setlist[arrows,1]{label=\tiny\ding{252}}
\setlist[arrows,2]{label=\tiny\ding{212}}
\setlist[arrows,3]{label=\tiny\ding{232}}
\setlist[arrows,4]{label=\tiny\ding{217}}
ü flying devices
Ô biplanes
Ô jets
Ô of transport
è of a single engine
Ù to reaction
Ù to helix
è different motors
Ô helicopters
ü automobiles
Ô racing cars
Ô private cars
Ô trucks
ü bicycles
13
2 Improvements
2.2.1 Poetry
We can write poetry using the verse environment that bleeds to the left and also
to the right. To terminate the end of a verse two counter-turns are used: \\ i to
separate a stanza from the following we can leave more space (with \bigskip) or
less, with \medskip.
Joan Maragall
Poesies, 1895
2.2.2 Citacions
14
2.3 Minisec
2.2.2.1 quote
There are people who do not like to speak, write or think in Catalan. It
is the same people who do not like to talk, write or think.
Ovidi Montllor
2.2.2.2 quotation
There are people who do not like to speak, write or think in Catalan.
It is the same people who do not like to talk, write or think.
Ovidi Montllor
2.3 Minisec
Sometimes you want a header that is easily distinguished but that is very close
to the text, without too much vertical separation. The command \minisec of
the Koma-Script package creates this type of heading without any structural level
within the document. This minisection does not produce an entry in the Table of
Contents nor has any numbering.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum
ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue
eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et
lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida
placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent
eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada
eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci
eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
eget orci sit amet orci dignissim rutrum.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor
lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus.
Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae
15
2 Improvements
ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut
massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.
Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
2.4 Tables
Although there is a typographical law that says that vertical lines do not have to be
placed in the tables, a very interesting effect can be achieved if these vertical lines
are not long enough to touch the upper and lower horizontal lines, a cell
We do this by using the colortbl package that allows you to color the tables.
Then we define the color of the lines, in particular we make them gray with
\arrayrulecolor, and finally shorten the height of the lines:
\usepackage{colortbl}
\arrayrulecolor{gray}
\let\shline\hline
\def\hline{\noalign{\vskip3pt}\shline\noalign{\vskip4pt}}
16
2.5 Frames
2.5 Frames
With the help of the package bclogo you can create boxes and frames with an
image or logo, a title and the body of the text.
\usepackage[tikz]{bclogo}
\newcommand\novaimatge{\includegraphics[width=14pt]{write}}
\renewcommand\logowidth{14pt}
where write is the name of the image file that appears to the left as the logo of the
frame.
In the body of the frame you can put the desired text, even lists such as those
defined in the section ?? on page ??.
Objectives
I first objective
I second objective
I third objective
I fourth objective
17
3
Show
There are two infinite things:
the Universe and human
stupidity. And I’m not sure
about the Universe.
(Albert Einstein)
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor
lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus.
Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae
ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut
massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.
Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt
tristique, libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque
ante. Phasellus adipiscing semper elit. Proin fermentum massa ac quam. Sed diam
turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas lacinia. Nam ipsum
ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat
magna. Nunc eleifend consequat lorem. Sed lacinia nulla vitae enim. Pellentesque
tincidunt purus vel magna. Integer non enim. Praesent euismod nunc eu purus.
Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam
vulputate metus eu enim. Vestibulum pellentesque felis eu massa.
— 19 —
3 Show
Objectives
ü first objective
ü second objective
ü third objective
ü fourth objective
Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus tin-
cidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac
habitasse platea dictumst. Integer tempus convallis augue. Etiam facilisis. Nunc
elementum fermentum wisi. Aenean placerat. Ut imperdiet, enim sed gravida sol-
licitudin, felis odio placerat quam, ac pulvinar elit purus eget enim. Nunc vitae
tortor. Proin tempus nibh sit amet nisl. Vivamus quis tortor vitae risus porta vehic-
ula.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum
ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue
eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et
lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida
placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent
eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada
eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci
eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
eget orci sit amet orci dignissim rutrum.
1. first
2. second
3. third
4. fourth
5. fifth
6. sixth
7. seventh
20
3.1 Fourth section
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum
ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue
eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et
lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida
placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent
eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada
eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci
eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
eget orci sit amet orci dignissim rutrum.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor
lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus.
Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae
ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut
massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.
Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt
tristique, libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque
ante. Phasellus adipiscing semper elit. Proin fermentum massa ac quam. Sed diam
turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas lacinia. Nam ipsum
ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat
magna. Nunc eleifend consequat lorem. Sed lacinia nulla vitae enim. Pellentesque
tincidunt purus vel magna. Integer non enim. Praesent euismod nunc eu purus.
Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam
vulputate metus eu enim. Vestibulum pellentesque felis eu massa.
There are people who do not like to speak, write or think in Catalan. It
is the same people who do not like to talk, write or think.
Ovidi Montllor
21
3 Show
Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus tin-
cidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac
habitasse platea dictumst. Integer tempus convallis augue. Etiam facilisis. Nunc
elementum fermentum wisi. Aenean placerat. Ut imperdiet, enim sed gravida sol-
licitudin, felis odio placerat quam, ac pulvinar elit purus eget enim. Nunc vitae
tortor. Proin tempus nibh sit amet nisl. Vivamus quis tortor vitae risus porta vehic-
ula.
Fusce mauris. Vestibulum luctus nibh at lectus. Sed bibendum, nulla a faucibus
semper, leo velit ultricies tellus, ac venenatis arcu wisi vel nisl. Vestibulum diam.
Aliquam pellentesque, augue quis sagittis posuere, turpis lacus congue quam, in
hendrerit risus eros eget felis. Maecenas eget erat in sapien mattis porttitor.
Vestibulum porttitor. Nulla facilisi. Sed a turpis eu lacus commodo facilisis. Morbi
fringilla, wisi in dignissim interdum, justo lectus sagittis dui, et vehicula libero dui
cursus dui. Mauris tempor ligula sed lacus. Duis cursus enim ut augue. Cras ac
magna. Cras nulla. Nulla egestas. Curabitur a leo. Quisque egestas wisi eget nunc.
Nam feugiat lacus vel est. Curabitur consectetuer.
Morbi luctus, wisi viverra faucibus pretium, nibh est placerat odio, nec commodo
wisi enim eget quam. Quisque libero justo, consectetuer a, feugiat vitae, portti-
tor eu, libero. Suspendisse sed mauris vitae elit sollicitudin malesuada. Maecenas
22
3.1 Fourth section
ultricies eros sit amet ante. Ut venenatis velit. Maecenas sed mi eget dui varius
euismod. Phasellus aliquet volutpat odio. Vestibulum ante ipsum primis in fau-
cibus orci luctus et ultrices posuere cubilia Curae; Pellentesque sit amet pede ac
sem eleifend consectetuer. Nullam elementum, urna vel imperdiet sodales, elit
ipsum pharetra ligula, ac pretium ante justo a nulla. Curabitur tristique arcu eu
metus. Vestibulum lectus. Proin mauris. Proin eu nunc eu urna hendrerit faucibus.
Aliquam auctor, pede consequat laoreet varius, eros tellus scelerisque quam, pel-
lentesque hendrerit ipsum dolor sed augue. Nulla nec lacus.
23