~gumara/ubuntu-desktop-course/ubuntu-desktop-course-th-gumara

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