~ricardo-cropalato/ubuntu-desktop-course/ubuntu-desktop-course-pt-br-ricardo-cropalato

86.2.7 by Torsten Spindler
Updte to styles
1
%%
86.2.8 by Torsten Spindler
New Stylesheet
2
%% Default dblatex DocBook style
86.2.7 by Torsten Spindler
Updte to styles
3
%%
4
\NeedsTeXFormat{LaTeX2e}
86.2.8 by Torsten Spindler
New Stylesheet
5
\ProvidesPackage{docbook}[2007/04/04 DocBook Style]
6
86.2.13 by Torsten Spindler
more changes to the latex stylesheet
7
86.2.8 by Torsten Spindler
New Stylesheet
8
% The defined options
9
\DeclareOption{hyperlink}{ \def\DBKhyperlink{yes} }
10
\DeclareOption{nohyperlink}{ \def\DBKhyperlink{no} }
11
12
\ifx\undefined\chapter
13
  \def\DBKisarticle{1}
14
\else
15
  \def\DBKisarticle{0}
16
\fi
17
18
% Default values
19
\ExecuteOptions{nohyperlink}
20
21
% If defined, process the options
22
\ProcessOptions\relax
23
24
% ##############################################################################
25
% ### DocBook and local commands
26
% ##############################################################################
27
% Default DocBook Parameters
86.2.7 by Torsten Spindler
Updte to styles
28
\newcommand{\DBKreference}{}
29
\newcommand{\DBKtitle}{Main Title}
30
\newcommand{\DBKsubtitle}{}
31
\newcommand{\DBKdate}{\today}
32
\newcommand{\DBKsite}{}
33
\newcommand{\DBKedition}{}
34
\newcommand{\DBKreleaseinfo}{Working Paper}
86.2.10 by Torsten Spindler
Add logo and copyright
35
\newcommand{\DBKpubdate}{2007}
86.2.14 by Torsten Spindler
moved license to own document
36
\newcommand{\DBKlegalblock}{cc-by-nc-sa}
37
\input creativecommons.tex 
86.2.13 by Torsten Spindler
more changes to the latex stylesheet
38
\newcommand{\DBKlegaltitle}{Creative Commons - Share Alike, Non Commercial}
86.2.10 by Torsten Spindler
Add logo and copyright
39
\newcommand{\DBKcopyright}{Copyright by the fabulous Ubuntu Training Community, 2007\\}
86.2.7 by Torsten Spindler
Updte to styles
40
86.2.8 by Torsten Spindler
New Stylesheet
41
% Local commands
42
\newcommand{\DBKtoclof}{true}
43
\newcommand{\DBKauthor}{}
44
45
% Adaptation...
86.2.10 by Torsten Spindler
Add logo and copyright
46
\setcounter{secnumdepth}{3}
47
\setcounter{tocdepth}{3}
86.2.8 by Torsten Spindler
New Stylesheet
48
49
\setlength\parskip{\medskipamount}
50
\setlength\parindent{0pt}
51
52
% Don't want paragraph indentation in abstract
53
\let\stdabstract=\abstract
54
\let\endstdabstract=\endabstract
55
\renewenvironment{abstract}{
56
  \begin{stdabstract}%
57
  \noindent%
58
  \setlength\parskip{\medskipamount}%
59
  \setlength\parindent{0pt}%
60
}{
61
  \end{stdabstract}
62
}
63
64
65
66
% We want paragraph + subparagraph headers like the others
67
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
68
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
69
                                     {1ex \@plus .2ex}%
70
                                     {\normalfont\normalsize\bfseries}}
71
72
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
73
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
74
                                     {1ex \@plus .2ex}%
75
                                     {\normalfont\normalsize\bfseries}}
76
77
% To have title rendering changed
78
\usepackage[sf,bf]{titlesec}
79
80
81
% ##############################################################################
82
% ### Page Parameters
83
% ##############################################################################
84
\setlength{\paperwidth}{21cm}
85
\setlength{\paperheight}{29.7cm}
86
\setlength{\hoffset}{-1in}
87
\setlength{\voffset}{-1in}
88
\setlength{\oddsidemargin}{2cm}
89
\setlength{\marginparsep}{0cm}
90
\setlength{\marginparwidth}{0cm}
91
\setlength{\textwidth}{18cm}
92
\setlength{\topmargin}{0.5cm}
93
\setlength{\headsep}{2cm}
94
95
\setlength{\textheight}{24cm}
96
\setlength{\footskip}{1.5cm}
97
98
99
% ##############################################################################
100
% ### Used Packages
101
% ##############################################################################
102
\makeatletter
103
% Postscript Graphics
104
\usepackage{graphicx}
105
106
% Miscellaneous
107
\usepackage{calc}
108
\usepackage{multirow}
109
\usepackage{subfigure}
110
\usepackage{ifthen}
111
\usepackage{tabularx}
112
113
\usepackage{dbk_fonts}
114
\usepackage{dbk_hyper}
115
116
\usepackage{fancyhdr}
117
118
% To have fancy <programlisting>
119
\usepackage{fancyvrb}
120
121
% ##############################################################################
122
% ### Some DocBook floats and environments
123
% ##############################################################################
124
125
%% Inclusion of float package after hyperref to have its definitions!
126
\usepackage{float}
127
128
\if1\DBKisarticle
129
130
\floatstyle{ruled}
131
\newfloat{example}{htb}{loe}[section]
132
\floatname{example}{\examplename}
133
134
\floatstyle{plain}
135
\newfloat{dbequation}{htb}{loe}[section]
136
\floatname{dbequation}{{\scshape Equation }}
137
138
% Redefinition of tableofcontent, to have it in separate pages
139
\let\stdtoc=\tableofcontents
140
\def\tableofcontents{ \newpage \stdtoc{} \newpage} 
141
142
\else
143
144
\floatstyle{ruled}
145
\newfloat{example}{htb}{loe}[chapter]
146
\floatname{example}{\examplename}
147
148
\floatstyle{plain}
149
\newfloat{dbequation}{htb}{loe}[chapter]
150
\floatname{dbequation}{{\scshape Equation }}
151
152
\fi
153
% Sidebar is a boxed minipage that can contain verbatim
154
\newenvironment{sidebar}[1][0.95\textwidth]{
155
  \hspace{0mm}\newline%
156
  \noindent\begin{Sbox}\begin{minipage}{#1}%
157
  \setlength\parskip{\medskipamount}%
158
}{
159
  \end{minipage}\end{Sbox}\shadowbox{\TheSbox}%
160
}
161
162
163
% ##############################################################################
164
% ### Title and Bookinfo display
165
% ##############################################################################
166
\def\title#1{\renewcommand{\DBKtitle}{#1}}
167
168
% Redefine author so that it can be used by the domitete
169
\def\author#1{\renewcommand{\DBKauthor}{#1}}
170
171
% Redefine how to print the cover page and book infos
172
\def\maketitle{
173
  \DBKcover
174
  \if\DBKcopyright\@empty\else
175
    \DBKcopyright \\
176
  \fi
177
  \if\DBKlegalblock\@empty\else
178
    \DBKlegalblock
179
  \fi
180
  \newpage
181
}
182
183
% How to render a <legalnotice>
184
\newenvironment{DBKlegalnotice}{
185
  \if@twocolumn
186
    \noindent\small\textit{\DBKlegaltitle}
187
    \/\bfseries---$\!$
188
  \else
189
    \if\DBKlegaltitle\@empty\else
190
      \noindent\begin{center}\small\bfseries\DBKlegaltitle\end{center}%
191
    \fi
192
    \begin{quote}\small
193
  \fi
194
}{
195
  \vspace{0.6em}\par\if@twocolumn\else\end{quote}\fi
196
}
197
198
% ##############################################################################
199
% ### Index redefinition
200
% ##############################################################################
201
202
% Index is redefined to have the section numbered, and to have a correct page
203
% count
204
\renewenvironment{theindex}
205
{ 
206
  \if@twocolumn
207
    \@restonecolfalse
208
  \else
209
    \@restonecoltrue
210
  \fi
211
  \columnseprule \z@
212
  \columnsep 35\p@
213
  \pagebreak
214
  \@ifundefined{chapter}{
215
    \twocolumn[\section{\indexname}]%
216
  }{
217
    % To not have the number, replace makechapterhead by
218
    % makeschapterhead
219
    % \chapter{\indexname}{%
220
    % \@mkboth{\MakeUppercase\indexname}%
221
    %        {\MakeUppercase\indexname}
222
    % }%
223
    \refstepcounter{chapter}
224
    \twocolumn[\@makechapterhead{\indexname}]%
225
  }
226
  \thispagestyle{plain}\parindent\z@
227
  \parskip\z@ \@plus .3\p@\relax
228
  \let\item\@idxitem
229
}{\if@restonecol\onecolumn\else\clearpage\fi}
230
231
\let\stdindex=\theindex
232
\let\endstdindex=\endtheindex
233
\renewenvironment{theindex}{
234
  \begin{stdindex}
235
  \@ifundefined{chapter}{}{
236
    % To not have the number, replace by:
237
    % \addcontentsline{toc}{chapter}{\numberline{}\indexname}
238
    \addcontentsline{toc}{chapter}{\numberline{\thechapter}\indexname}
239
  }
240
}{
241
  \label{LastPage}%
242
  \end{stdindex}
243
}
244
245
246
% ##############################################################################
247
% ### Commands and environments
248
% ##############################################################################
249
\newcommand{\draft}{\special{!userdict begin /bop-hook{gsave 200 30 translate %
250
         65 rotate /Times-Roman findfont 216 scalefont setfont %
251
         0 0 moveto 0.8 setgray (DRAFT) show grestore}def end}}
252
253
\AtEndDocument{%
254
  \label{LastPage}%
255
}
256
\usepackage{refcount}
257
258
\usepackage{dbk_locale}
259
\usepackage{dbk_title}
260
\usepackage{dbk_headfoot}
261
\usepackage{dbk_revision}
262
\usepackage{dbk_admonition}
263
\usepackage{dbk_changebar}
264
\usepackage{dbk_biblio}
265
\usepackage{dbk_table}
266
\usepackage{dbk_item}
267
\usepackage{dbk_graphic}
268
\usepackage{dbk_verbatim}
269
\usepackage{dbk_callout}
270
\usepackage{dbk_annot}
271
272
\makeatother
273
86.2.15 by Torsten Spindler
Change logo position
274
\rfoot{
275
\includegraphics[width=1in]{images/ubuntu.png}
276
}
277
86.2.13 by Torsten Spindler
more changes to the latex stylesheet
278
\cfoot{
279
\includegraphics[width=1in]{images/cc-by-sa-nc-88x31.png}
280
}
281
112.1.5 by Torsten Spindler
Manul pagebreaks in chapter 1 - 3
282
%\let\origfigure\figure
283
%\renewcommand{\figure}{\nopagebreak[4] \origfigure }{\pagebreak[0]}
284
285
%\let\origsection\section
286
%\renewcommand{\section}{\pagebreak[4]\origsection}
287
288
%\let\origsubsection\subsection
289
%\renewcommand{\subsection}{\pagebreak[2]\origsubsection}
86.2.13 by Torsten Spindler
more changes to the latex stylesheet
290
291
\let\origitem\item
86.2.14 by Torsten Spindler
moved license to own document
292
\renewcommand{\item}{\pagebreak[2]\origitem}{\nopagebreak[0]}
86.2.10 by Torsten Spindler
Add logo and copyright
293