Debian Codegraph @

texmf-dist/doc/latex/bfh-ci/DEMO-BFHPub.tex

raw
1 \documentclass[
2 % invert-title=true,
3 % titlepage=false,
4 % titleimage-ratio=34
5 ]{bfhpub} % KOMA-script report
6 %----------------- Base packages --------------------------------------
7 % Include Packages
8 \usepackage[french,ngerman,main=english]{babel}
9 %---------------------------------------------------------------------------
10 % Hyperref Package (Create links in a pdf)
11 %---------------------------------------------------------------------------
12 \usepackage[
13 hidelinks,
14 pdfusetitle
15 ]{hyperref}
16
17
18 % document specific setup.
19 % Should not be included for own documents!
20 \usepackage{multicol}
21
22 \newcommand*{\pkg}[1]{\texttt{#1}}
23 \newcommand*{\cls}[1]{\texttt{#1}}
24 \newcommand*{\code}[1]{\texttt{#1}}
25 \newcommand*{\file}[1]{\texttt{#1}}
26 \newcommand*{\opt}[1]{\texttt{#1}}
27
28 \newcommand\BFHcolorBox[1]{\textcolor{#1}{\rule{2em}{1em}}\hspace{0.5em}#1}
29
30 \LoadBFHModule{terminal,boxes,rules}
31
32 %\tcbuselibrary{minted}
33 \begin{document}
34
35 %---------------- BFH tile page -----------------------------------------
36 \title{BFH-CI}
37 \subtitle{\LaTeX{} Bundle for Bern University of Applied Sciences}
38 \author{Marei Peischl\thanks{[email protected]}}
39 % \subject{Subject}
40 \publishers{pei\TeX{}}
41 \institution{Bern University of Applied Sciences}
42 % \department{}
43 % \institute{Mikro- und Medizintechnik}
44 \version{2.0.0}
45 \date{2021/12/23}
46 %The starred variant will automatically scale and clip the image. the non-starred one will allow you to set the size yourself
47 \titlegraphic*{\includegraphics{example-image}}
48
49 \maketitle
50 %------------ TABLEOFCONTENTS ---------------
51 \tableofcontents
52
53
54 \section{Quickstart}
55 BFH-CI provides mechanisms for different types of documents.
56 Most mechanisms exist among all types. These can be extended by using the BFHModule mechanism (see \autoref{sec:bfhmodule}).
57
58 The release includes the following example files:
59
60 \begin{description}
61 \item[DEMO-BFHPub.tex] The source to this document. General example for print publications. There are some more specific variants for project proposals (\file{DEMO-BFHProjektProposal.tex}) or fact sheets (\file{DEMO-BFHFactsheet.tex}).
62 \item[DEMO-BFHBeamer.tex] Beamer presentations. There's also a variant with a sidebar in \file{DEMO-BFHBeamer-Sidebar.tex}
63 \item[DEMO-BFHThesis.tex] Thesis template including an affidavit and additional title fields.
64 \item[DEMO-BFHLetter.tex] Letters using \pkg{bfhletter} a layouting wrapper package for \pkg{scrletter}.
65 \item[DEMO-BFHSciPoster.tex] Scientific posters based on \pkg{tcolorbox}'s poster library.
66 \end{description}
67
68 \noindent It might be useful to start a new document using one of these example files.
69 An extended variant of this documentation and general advice for LaTeX users can be found at \url{https://latex.ti.bfh.ch}
70
71 \section{Helper packages}
72
73
74 The basic design elements for BFH-CI are implemented by the packages \pkg{bfhcolors}, \pkg{bfhfonts} and \pkg{bfhlogo}.
75 The latter one is not included in the CTAN Releas due to trademark restrictions.
76 Users can download it from the internal GitLab.
77 Detailed Information can be found at the installation instructions at \url{https://latex.ti.bfh.ch}.
78
79 These packages will be loaded automatically if one of the bfh-classes or the letter package are loaded.
80
81 The classes \cls{bfhpub} and \cls{bfhthesis} as well as the beamerarticle-mode of bfhbeamer also load the \pkg{bfhlayout} package.
82 It provides the basic layout functionality without a documentclass requirement.
83 Though it should not be loaded without a \KOMAScript{} class.
84
85
86 \subsection{bfhcolors}
87
88 \subsubsection{Available Colors}
89
90 The following table shows all by \pkg{bfhcolors} defined colors. For their usage please have a look at the \pkg{xcolor} documentation.
91
92 \medskip
93 \begin{tabular}{@{}lll}
94 \BFHcolorBox{BFH-DarkBlue} & \BFHcolorBox{BFH-MediumBlue} & \BFHcolorBox{BFH-LightBlue} \\
95 \BFHcolorBox{BFH-DarkGreen} & \BFHcolorBox{BFH-MediumGreen} & \BFHcolorBox{BFH-LightGreen} \\
96 \BFHcolorBox{BFH-DarkPurple} & \BFHcolorBox{BFH-MediumPurple} & \BFHcolorBox{BFH-LightPurple} \\
97 \BFHcolorBox{BFH-DarkOcher} & \BFHcolorBox{BFH-MediumOcher} & \BFHcolorBox{BFH-LightOcher} \\
98 \BFHcolorBox{BFH-DarkRed} & \BFHcolorBox{BFH-MediumRed} & \BFHcolorBox{BFH-LightRed} \\[1em]
99 \BFHcolorBox{BFH-Orange} &\BFHcolorBox{BFH-Gray}
100 \end{tabular}
101
102
103 \subsubsection{Package Options}
104
105 The \opt{colormode} option can be used to select the correct definitions for the output.
106 The names match the design guideline.
107
108 \begin{description}
109 \item[colormode=4CU] 4 colors uncoated paper (default)
110 \item[colormode=4CC] 4 colors coated paper
111 \item[colorode=RGB] RGB colors for screens or beamer presentations
112 \item[colormode=SW] grayscale for internal documents
113 \end{description}
114
115 \subsection{bfhfonts}
116
117 The CI guideline generally requires the Fonts Unit Slab Pro and Unit Rounded Pro.
118 Due to license restrictions these cannot be published together with BFH-CI.
119 BFH-CI provides fallbacks for Source Serif Pro and Nunito which will be loaded if the official fonts cannot be found.
120 If you want to use the official fonts please have a look at the installation instructions at \url{https://latex.ti.bfh.ch}.
121
122 These changes have been approved by the communications department and can be used as full replacements.
123
124 \pkg{bfhfonts} will try to load fontspec and only use Type 1 fonts if pdf\LaTeX{} is used to compile the documents.
125
126 \subsection{bfhlogo}
127
128 The \pkg{bfhlogo} package provides translations of the word marks of the BFH logo.
129 Generally this package will use the base language but there's also an option to provide multi language support.
130
131 \subsubsection{Package options}
132
133 \begin{description}
134 \item[language=] The language options accepts the self explaining values \verb+de+, \verb+fr+, \verb+en+, \verb+de_fr+, \verb+de_fr_en+.
135 \item[invert-logo-colors=true/false] This option can be used to invert the logo colors. It's internally used in some poster and beamer elements.
136 \item[trilingual/bilingual/monolingual] These keys only exist for compatibility reasons and will be mapped to the corresponding \verb+language=+ options.
137 \end{description}
138
139 \section{The base layout for text documents}
140 The base mechanism for all text documents is provided using the \pkg{bfhlayout} package.
141 \cls{bfhpub} and \cls{bfhthesis} load this package. The other bfh-classes provide the functionality differently.
142 Please have a look at the corresponding demo files if you use want to create another document type.
143
144 \cls{bfhpub} and \cls{bfhthesis} will pass all their document class options to this package.
145 \begin{description}
146 \item[titleimage-ratio=] This choice key accepts the values \code{12} (1:2),\code{13} (1:3), \code{23} (2:3), \code{34} (3:4), \code{56} (5:6) , \code{1011} (10:11).
147 It will adjust the size of the colored area or titlegraphic on the titlepage.
148 For \cls{bfhthesis} some values might be forbidden if the title information takes too much space.
149
150 The value is initialized to \code{titleimage-ratio=12}. the value will be ignored if no titlepage is generated e.\,g. with \code{titlepage=false}.
151
152 \item[invert-title=true/false] This switch toggles the color of text \& logo on the titlepage. If set to true, the base colors of titlepage (BFH-Orange/BFH-Gray) are switched.
153 \end{description}
154
155
156 \section{Additional layout modules}
157 \label{sec:bfhmodule}
158
159 To support some layout elements among all document types BFH-CI introduces the Macro
160 \begin{verbatim}
161 \LoadBFHModule{<List of Modules>}
162 \end{verbatim}
163
164 These modules can be used to extend the basic mechanisms on additional elements.
165
166 Currently there are 3 Modules prepared:
167 \begin{itemize}
168 \item tabular
169 \item listings
170 \item terminal
171 \item boxes
172 \item rules
173 \end{itemize}
174
175 The corresponding filenames following the structure \file{bfh-layout-<modulename>.cfg}. User defined modules can be added.
176
177 \subsection{The table module}
178
179 This module is automatically loaded by all document types beside \cls{bfhletter.cls}.
180
181 \begin{verbatim}
182 \LoadBFHModule{tabular}
183 \end{verbatim}
184
185 BFH-CI should used colored tabulars. It combined all necessary adjustments in the \verb+\setupBfhTabular+ macro. It will adjust the rowcolor using \pkg{xcolor}. To use the recommended tabular setup one could use:
186
187 \begin{verbatim}
188 \begin{table}
189 \centering
190 \setupBfhTabular
191 \begin{tabular}{lll}
192 \rowcolor{BFH-tablehead}
193 Header 1&Header 2&Header3\\\hline
194 Content 11&Content 12&Content 13\\\hline
195 Content 21&Content 22&Content 23
196 \end{tabular}
197 \caption{table caption}
198 \label{table-label}
199 \end{table}
200 \end{verbatim}
201
202 \begin{table}[ht]
203 \centering
204 \setupBfhTabular
205 \begin{tabular}{lll}
206 \rowcolor{BFH-tablehead}
207 Header 1&Header 2&Header3\\\hline
208 Content 11&Content 12&Content 13\\\hline
209 Content 21&Content 22&Content 23
210 \end{tabular}
211 \caption{table caption}
212 \label{table-label}
213 \end{table}
214
215 To simplify the usage the \pkg{bfhlayout} also provides a \verb+bfhTabular+ environment. The upper example would be equal to:
216
217 \begin{verbatim}
218 \begin{table}
219 \begin{bfhTabular}{lll}
220 Header 1&Header 2&Header3\\
221 Content 11&Content 12&Content 13\\
222 Content 21&Content 22&Content 23
223 \end{bfhTabular}
224 \caption{table caption}
225 \label{table-label}
226 \end{table}
227 \end{verbatim}
228
229 In case the package \pkg{tabularray} is loaded the tabular module will also implement a tblr environ to use the layout.
230 For further usage information please have a look at the \pkg{tabularray} documentation.
231
232 \begin{verbatim}
233 \begin{bfhTblr}{lll}
234 Header 1&Header 2&Header3\\
235 Content 11&Content 12&Content 13\\
236 Content 21&Content 22&Content 23
237 \end{bfhTblr}
238 \end{verbatim}
239
240 \subsection{listings module}
241
242 Loades the \pkg{listings} package and adjusts colors for the listing environments to match the CI.
243
244 \subsection{terminal module}
245
246 Provides some terminal mechanisms to be similar to OSX and ubuntu terminals.
247 The mechanism is based on \pkg{tcolorbox} and either \pkg{listings} or \pkg{minted} can be used as listing engine.
248
249 The syntax was adapted from internal packages providing this functionality.
250 Therefore the syntax for adjusting the terminal propmts is slightly different for the minted engine in contrast to listings.
251
252 The following examples show the difference.
253
254 Please pay attention to the fact that the current implementation to change the prompt needs global assignments. A reset at start of a new terminal environment might be required.
255
256
257 \begin{multicols}{2}[\subsubsection{terminal using listings}]
258 \tcbset{listing engine=listings}
259 \setupLinuxPrompt{student}
260 \begin{ubuntu}
261 whoami `\StartConsole`
262 student `\setupLinuxPrompt{student}`
263 sudo su `\setupLinuxPrompt{root}`
264 hostname `\StartConsole`
265 ubuntu`\setupLinuxPrompt{root}`
266 ssh bob@remotehost`\StartConsole`
267 student@remotehost's`\ `password:
268 Linux remote host 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686
269 You have mail.
270 Last login: Wed Oct 16 01:12:35 2012 from localhost`\setupLinuxPrompt{remote}`
271 whoami`\StartConsole`
272 user`\setupLinuxPrompt{remote}`
273 _
274 \end{ubuntu}
275
276 \begin{macos}
277 whoami `\StartConsole`
278 root `\setupOSXPrompt{root}`
279 hostname `\StartConsole`
280 ubuntu`\setupOSXPrompt{root}`
281 ssh bob@remotehost`\StartConsole`
282 bob@remotehost's`\ `password:
283 Linux remote host 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686
284 You have mail.
285 Last login: Wed Oct 16 01:12:35 2012 from localhost`\setupOSXPrompt{remote}`
286 whoami`\StartConsole`
287 user`\setupOSXPrompt{remote}`
288 _
289 \end{macos}
290 \end{multicols}
291
292 \subsubsection{terminal environment with more optional arguments}
293 There is a newer version of the terminal environment which is fully compliant to the initial variant. The evolution of this environment provides the follwoing fatures.
294
295 \begin{itemize}
296 \item provides \verb|\setupLinuxPrompt[user][host][pwd][prompt char][pwd chars]|
297 \item preserves \verb|\setupLinuxPrompt{student}| command uses instead of \verb|\newcommand| use \verb|\NewDocumentCommand|
298 \item the \verb|[pwd chars]| limit the chars count of \verb|[pwd]| string and thus truncate the string. It is useful in multi column context to limit prompt overrun.
299 \end{itemize}
300
301 \setupLinuxPrompt[john][myserver][][\$ ]{color=BFH-LightGreen}
302
303 \begin{ubuntu}
304 Set-ExecutionPolicy Unrestricted -Scope Process `\StartConsole`
305 Die Ausführungsrichtlinie trägt zum Schutz vor nicht vertrauenswürdigen Skripts bei. ... Möchten Sie die Ausführungsrichtlinie ändern?
306 [J]Ja [A]Ja,alle [N]Nein [K]Nein,keine [H]Anhalten [?]Hilfe
307 (Standard ist "N"): J`\setupLinuxPrompt{student}`
308 python -m venv btm1503venv # create new virtual environment
309 cd btm1503venv`\setupLinuxPrompt[john][myserver][/home/john/btm1503venv][\$ ]{color=green}`
310 .\Scripts\activate # work within venv -> '(btm1503venv)' prompt `\setupLinuxPrompt[(btm1503venv)john][myserver][/home/john/btm1503venv][\$ ]{color=green}`
311 pip install spyder-kernels numpy mnist
312 deactivate # exit virtual environment after you are done
313 \end{ubuntu}
314
315
316 \subsubsection{terminal using minted}
317
318 This section is commented because minted has to be set up to use it.
319 In case this should be used minted has been loaded before the terminal module.
320
321 %\tcbset{listing engine=minted}
322 %\begin{multicols}{2}
323 %\setupLinuxPrompt{student}
324 %\begin{ubuntu}
325 % whoami
326 % student `\StartConsole`
327 % sudo su `\setupLinuxPrompt{student}`
328 % hostname `\setupLinuxPrompt{root}`
329 % ubuntu`\StartConsole`
330 % ssh bob@remotehost`\setupLinuxPrompt{root}`
331 % student@remotehost's`\ `password: `\StartConsole`
332 % Linux remotehost 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686
333 % You have mail.
334 % Last login: Wed Oct 16 01:12:35 2012 from localhost
335 % whoami`\setupLinuxPrompt{remote}`
336 % user`\StartConsole`
337 % _`\setupOSXPrompt{remote}`
338 %\end{ubuntu}
339 %
340 %\setupOSXPrompt{student}
341 %\begin{macos}
342 % whoami
343 % root`\StartConsole`
344 % hostname`\setupOSXPrompt{root}`
345 % ubuntu`\StartConsole`
346 % ssh bob@remotehost`\setupOSXPrompt{root}`
347 % bob@remotehost's`\ `password:`\StartConsole`
348 % Linux remotehost 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686
349 % You have mail.
350 % Last login: Wed Oct 16 01:12:35 2012 from localhost
351 % whoami`\setupOSXPrompt{remote}`
352 % user`\StartConsole`
353 % _`\setupOSXPrompt{remote}`
354 %\end{macos}
355 %\end{multicols}
356
357 \subsection{boxes module}
358
359 The boxes module provides box environments based on the BFH coporate identity.
360 All of them follow the same syntax:
361
362 \begin{verbatim}
363 \begin{ENV_TYPE}[COLOR_OPTION]{BOX TITLE}
364 Some text displayed in the color box.
365 \end{ENV_TYPE}
366 \end{verbatim}
367
368 General use of the BFH notification box environment.
369 \begin{verbatim}
370 \begin{NOTIFICATION_TYPE}
371 Some text displayed in the color box.
372 \end{NOTIFICATION_TYPE}
373 \end{verbatim}
374
375
376 \subsubsection{The general purpose box}
377 The BFH color box using the option to set user defined color.
378
379 \begin{verbatim}
380 \begin{bfhBox}[BFH-MediumBlue]{\texttt{bfhBox}}
381 Color provided by \texttt{bfhcolors} package: \texttt{BFH-MediumBlue}
382 \end{bfhBox}
383 \end{verbatim}
384
385
386 \begin{bfhBox}[BFH-MediumBlue]{\texttt{bfhBox}}
387 Color provided by \texttt{bfhcolors} package: \texttt{BFH-MediumBlue}
388 \end{bfhBox}
389
390 The box without the color option falls back to default color box in BFH medium green.
391
392 \begin{verbatim}
393 \begin{bfhBox}{\texttt{bfhBox}}
394 Color provided by \texttt{bfhcolors} package: \texttt{BFH-MediumGreen}
395 Default color
396 \end{bfhBox}
397 \end{verbatim}
398
399 \begin{bfhBox}{\texttt{bfhBox}}
400 Color provided by \texttt{bfhcolors} package: \texttt{BFH-MediumGreen}
401 Default color
402 \end{bfhBox}
403
404
405 \subsubsection{Theme boxes}
406
407 \begin{verbatim}
408 \begin{bfhAlertBox}
409 Some text to emphasis.
410 \end{bfhAlertBox}
411 \end{verbatim}
412
413 \begin{bfhAlertBox}
414 An alert box.
415 \end{bfhAlertBox}
416
417 \begin{verbatim}
418 \begin{bfhWarnBox}
419 Some text to emphasis.
420 \end{bfhWarnBox}
421 \end{verbatim}
422
423 \begin{bfhWarnBox}
424 A warning box.
425 \end{bfhWarnBox}
426
427 \begin{verbatim}
428 \begin{bfhNoteBox}
429 Some text to emphasis.
430 \end{bfhNoteBox}
431 \end{verbatim}
432
433 \begin{bfhNoteBox}
434 A note box.
435 \end{bfhNoteBox}
436
437 \begin{verbatim}
438 \begin{bfhRecycleBox}
439 Some text to emphasis.
440 \end{bfhRecycleBox}
441 \end{verbatim}
442
443 \begin{bfhRecycleBox}
444 A recycle box.
445 \end{bfhRecycleBox}
446
447 \begin{verbatim}
448 \begin{bfhReadBox}
449 Some text to emphasis.
450 \end{bfhReadBox}
451 \end{verbatim}
452
453 \begin{bfhReadBox}
454 A read box.
455 \end{bfhReadBox}
456
457
458 \begin{verbatim}
459 \begin{bfhProcessingBox}
460 Some text to emphasis.
461 \end{bfhProcessingBox}
462 \end{verbatim}
463
464 \begin{bfhProcessingBox}
465 A processing box.
466 \end{bfhProcessingBox}
467
468 \subsection{rules module}
469 The rules module adds user macros to create separation rules as described in the CI guideline.
470
471 \begin{verbatim}
472 \bfhRule[optional length]
473 \end{verbatim}
474
475 \bfhRule
476
477 \end{document}