1\ProvidesPackage{bdefinitions}[2016/11/21]
2
3\RequirePackage{minitoc}
4\RequirePackage[left=4cm,right=3cm,bottom=2cm,top=2.5cm]{geometry}
5
6\newlength\myTextWidth
7\newlength\myXTextPosition
8\newlength\myXBoxPosition
9\newlength\myBoxWidth
10\newlength\myTextSize
11\setlength{\myBoxWidth}{2cm}
12\setlength{\myTextSize}{\myBoxWidth*\ratio{6mm}{10mm}}
13
14\def\bauthor{\@author}
15\input{class-definitions}
16%%
17\input{color-definitions}
18%%
19%% The following color is used to emphasis the URL (in the most wide sense of the term) writing.
20\colorlet{colorhref}{btextcolor}%%\definecolor{colorhref}{rgb}{0.451., 0., 0.}
21%%
22
23\def\bmacro#1#2#3#4{\texttt{$\backslash{}$#1}\{#2\}\{#3\}: #4}
24\newcommand{\bcolorprotect}[1]{
25  \def\text{#1}%
26  \scancs{\result}{\text}%
27  \StrDel[1]{\result}{ }[\result]%
28  \textcolor{btextcolor}{\texttt{\result}}
29}
30\newcommand\bprotect[1]{%
31\def\text{#1}%
32\scancs{\result}{\text}%
33\StrDel[1]{\result}{ }[\result]%
34\texttt{\result}
35}
36\def\bdirectoryname#1{\textcolor{bdircolor}{\texttt{#1}}}
37\def\bdirectory#1{\bdirectoryname{#1} directory}
38\newcommand{\btool}[1]{\textcolor{btoolcolor}{\texttt{#1}}}
39%
40\newcommand{\bdirectivename}[1]{\textbf{#1}}
41\newcommand{\bdirective}[1]{\bdirectivename{#1} directive}
42\newcommand{\bresourcename}[1]{\texttt{#1}}
43\newcommand{\bresource}[1]{\bresourcename{#1} resource}
44\newcommand{\bresources}[1]{\bresourcename{#1} resources}
45\newcommand{\bresourceq}[1]{\bresourcename{#1}'s resource}
46\newcommand{\bcommandname}[1]{\textcolor{bcommandcolor}{\texttt{#1}}}
47\newcommand{\bcommand}[1]{\bcommandname{#1} command}
48\newcommand{\bbracket}[1]{\lt{}#1\gt{}}
49\newcommand{\bvalue}[1]{\textcolor{bcommandcolor}{\dotuline{#1}}}
50\newcommand{\bkeyword}[1]{\bvalue{#1}}
51\newcommand{\bhighlight}[1]{\textcolor{btextcolor}{#1}}
52\newcommand{\bheader}[1]{\textcolor{opposite}{\textbf{#1}}}
53\newcommand{\bsubheader}[1]{\emph{#1}}
54\newcommand{\bnextpage}{\small{\emph{Continues on the following page}}}
55\newcommand{\bcontcaption}{\small{\emph{[]Cont.}}}
56\newcommand{\babove}{$\geqslant$}
57\newcommand{\bstar}{$\star$}
58\newcommand{\byesorno}{\bbracket{yes\vb{}no}}
59\newcommand{\bzeroone}{\bbracket{0\vb{}1}}
60\newcommand{\btable}[1]{\texttt{#1}}
61\newcommand{\bdefaultvalue}[1]{\textcolor{btextcolor}{#1}}
62\newcommand{\bstructure}[1]{\texttt{#1} structure}
63\newcommand{\bstructurename}[1]{\texttt{#1}}
64\newcommand{\bfunction}[1]{\texttt{#1} function}
65\newcommand{\bfunctionname}[1]{\texttt{#1}}
66\newcommand{\bevent}[1]{\texttt{#1} event}
67\newcommand{\beventname}[1]{\texttt{#1}}
68\newcommand{\byear}{\the\year}
69\newcommand{\bstatus}[1]{\emph{#1}}
70\newcommand{\bpackage}[1]{\texttt{#1}}
71\newcommand{\bvalueddirective}[2]{\bdirectivename{#1}=\bvalue{#2}}
72\newcommand{\bjobtype}[1]{\bhighlight{#1}}
73%%%
74%%% Includes a graphic
75%%% Parameters:
76%%% #1: image filename, *without* *extension*
77%%% #2: Caption
78%%% #3: Label to use. Default is bimg-image_filename
79%%%
80%%% No orientation, just as it is provided.
81\newcommand{\bimageN}[4][0.95\linewidth]{
82  \begin{figure}[htpb]
83    \begin{center}
84      \includegraphics[width=#1]{#2}
85      \caption{#3}\ifthenelse{\equal{#4}{}}{\label{bimg-#2}}{\label{#4}}
86    \end{center}
87  \end{figure}
88}
89%%%
90%%% Horizontally, because the picture is in landscape by nature.
91\newcommand{\bimageH}[4][0.95\linewidth]{
92  \begin{figure}[htpb]
93    \begin{center}
94      \includegraphics[width=#1]{#2}
95      \caption{#3}\ifthenelse{\equal{#4}{}}{\label{bimg-#2}}{\label{#4}}
96    \end{center}
97  \end{figure}
98}
99%%%
100%%% Vertically, because the picture is in portrait by nature.
101\newcommand{\bimageV}[4][0.95\linewidth]{
102  \begin{figure}[htpb]
103    \begin{center}
104      \includegraphics[height=#1]{#2}
105      \caption{#3}\ifthenelse{\equal{#4}{}}{\label{bimg-#2}}{\label{#4}}
106    \end{center}
107  \end{figure}
108}
109%%%
110%%% Some definition to write always with the same layout:
111%%%
112%%% a filename
113\def\bfilename#1{\textcolor{bfilecolor}{\path{#1}}}
114%%% the name ``Bacula'' and others
115\def\bacula{Bacula}
116\def\bconsole{\bacula{} \textbf{Console}}
117\def\bdirector{\bacula{} \textbf{Director}}
118\newcommand{\bdate}{\the\year}
119\newcommand{\btitlelogo}{\includegraphics[width=0.3\linewidth]{blogo}}
120
121\input{edition}
122
123
124%%% BAT has also an acronym
125\def\bat{\acs{BAT}}
126%%% The main manual name
127\def\bmainman{\bacula{} \bedition{} Main manual}
128%%% Console manual name
129\def\bconsoleman{\bacula{} \bedition{} Console manual}
130%%% Developers guide
131\def\bdevelman{\bacula{} \bedition{} Developer's manual}
132%%% Utility manual
133\def\butilityman{\bacula{} \bedition{} Utility programs}
134%%% Misc manual
135\def\bmiscman{\bacula{} \bedition{} Miscellaneous Guide}
136%%% Problems resolution guide
137\def\bproblemman{\bacula{} \bedition{} Problems Resolution Guide}
138%%
139\def\bConsole{\bresourcename{Console}}
140\def\bCatalog{\bresourcename{Catalog}}
141\def\bJob{\bresourcename{Job}}
142\def\bDirector{\bresourcename{Director}}
143\def\bClient{\bresourcename{Client}}
144\def\bPool{\bresourcename{Pool}}
145\def\bconsolename{\bcommandname{bconsole}}
146\def\bdirectorname{\texttt{Director}}
147\def\bJobId{\bresourcename{JobId}}
148\def\bVolume{\bresourcename{Volume}}
149\def\bFileSet{\bresourcename{FileSet}}
150\def\bStorage{\bresourcename{Storage}}
151\def\bDevice{\bresourcename{Device}}
152\newcommand{\bwebdoc}[1]{\label{#1}}
153%%
154%% Links
155\newcommand*{\bvref}[1]{\vref{#1}}
156\newcommand*{\bref}[2]{\href{#1}{\dotuline{#2}}}
157\newcommand*{\bfootref}[2]{\href{#1}{\dotuline{#2}\footnote{\href{#1}{\dotuline{#1}}}}}
158%% \newcommand*{\burl}[2]{\bref{#1}{\url{#2}}}%\href{#1}{\url{#2}}}
159%%
160%% Usage:
161%%       - \bilink{text}{label}
162%%       - \bulink{text}{URL}
163\newcommand*{\bilink}[2]{\htmlref{\textcolor{colorhref}{\dotuline{#1}}}{#2}}
164\def\bifootlink#1#2{\htmlref{\textcolor{colorhref}{\dotuline{#1}}\footnote{Cf. \vref{#2}}}{#2}}
165\newcommand*{\bulink}[2]{\bref{#2}{#1}}
166\newcommand*{\bufootlink}[2]{\bfootref{#2}{#1}}
167
168%%
169%% eXternal References macro: bxlink
170%%% #1: Text to display
171%%% #2: Label defined
172%%% #3: manual: main, console, misc, developers
173%%% #4: text as reference level. will be displayed ``as is''
174%%%
175%%% Example:
176%%% \bxlink{Console Configuration}{ConsoleConfChapter}{main}{chapter}
177%%% will display
178%%% Console Configuration chapter (chapter 30 on page 269)
179\newcommand*{\bxlink}[4]{\href{../#3/#3}{\textbf{#1}} #4 (#4 \ref{#3-#2} page \pageref{#3-#2})}
180%%
181%% Same for pointing to the document name only.
182%% \bxdlink{Text}{label}{manual}{type-of-reference}
183%% Will display
184%% Text (chapter XX on page YY)
185\newcommand*{\bxdlink}[4]{\href{../#3/#3}{\textbf{#1}} (#4 \ref{#3-#2} page \pageref{#3-#2})}
186
187
188%%
189%%
190\newcolumntype{C}{>{\centering\arraybackslash}X}
191\newcolumntype{R}{>{\raggedright\arraybackslash}X}
192\newcolumntype{L}{>{\raggedleft\arraybackslash}X} %% This is probably the same then X
193
194%% LaTeX GraphicPath directive is able to manage this.
195%% manuals/_lang_/_manual_name/
196\input{bgraphicpath}
197
198\def\arraystretch{1.1}
199\def\version{\input{version}}
200
201\newcommand{\dq}{\verb+"+}
202\newcommand{\vb}{$|$}
203\newcommand{\lt}{$<$}
204\newcommand{\gt}{$>$}
205%%
206%% Tools and names
207\newcommand{\mysql}{\texttt{MySQL}}
208\newcommand{\postgresql}{\texttt{PostgreSQL}}
209\newcommand{\sqlite}[1][~]{\texttt{SQLite}#1}
210\newcommand{\mtxchanger}{\btool{mtx-changer}}
211\newcommand{\mtx}{\btool{mtx}}
212\newcommand{\tar}{\btool{tar}}
213\newcommand{\bru}{\btool{bru}}
214\newcommand{\bdump}{\btool{dump}}
215\newcommand{\mssql}{\texttt{MSSQL}}
216\newcommand{\bweb}{BWeb}
217\newcommand{\baculasystems}{Bacula Systems}
218\newcommand{\oracle}{Oracle\texttrademark{}}
219
220%% copied from /usr/share/texmf/tex/latex/base/book.cls, and
221%%  modified to suit.  KEC 4-28-05
222%% KEC: Removed the two-column arrangement, and added \newpage
223\renewenvironment{theindex}
224                 {\if@twocolumn
225                   \@restonecolfalse
226                   \else
227                   \@restonecoltrue
228                   \fi
229                   %% KEC:  Switch to one column.
230                   %%              \columnseprule \z@
231                   %%              \columnsep 35\p@
232                   %%              \twocolumn[\@makeschapterhead{\indexname}]%
233                   \@mkboth{\MakeUppercase\indexname}%
234                           {\MakeUppercase\indexname}%
235                           \clearpage
236                           \subsection*{\indexname}
237                           \addcontentsline{toc}{subsection}{\indexname}
238                           \thispagestyle{plain}\parindent\z@
239                           \parskip\z@ \@plus .3\p@\relax
240                           \let\item\@idxitem}
241                 {\if@restonecol\onecolumn\else\clearpage\fi}   %% Is this needed???
242%%
243\endinput
244%%
245