Debian Codegraph @

texmf-dist/source/lualatex/hu-berlin-bundle/hu-berlin-bundle.dtx

raw
1 % \iffalse
2 %<*internal|cls|sty>
3 \def\Version{2023/05/14 v1.1.2}
4 %</internal|cls|sty>
5 %<*internal>
6 \iffalse
7 %</internal>
8 %<cls|sty>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
9 %<*cls&letter>
10 \ProvidesClass{hu-berlin-letter}
11 [\Version\ Humboldt-Universit"at zu Berlin - letter documentclass]
12 \ClassInfo{hu-berlin}{* * * hu-berlin * * *\MessageBreak
13 Part of the hu-berlin Bundle }
14 %</cls&letter>
15 %<*sty>
16 %<*style>
17 \ProvidesPackage{hu-berlin-bundle-style}
18 [\Version\space hu-berlin - package for style the documentation]
19 \PackageInfo{hu-berlin}{* * * hu-berlin * * *\MessageBreak
20 Part of the hu-berlin Bundle}
21 %</style>
22 %<*base>
23 \ProvidesPackage{hu-berlin-base}
24 [\Version\space hu-berlin - package for basic features]
25 \PackageInfo{hu-berlin}{* * * hu-berlin * * *\MessageBreak
26 Part of the hu-berlin Bundle}
27 %</base>
28 %</sty>
29 %<*driver>
30 \catcode9=12
31 \ProvidesFile{\jobname.dtx}
32 [\Version\space Documentation of the hu-berlin Bundle]
33 %</driver>
34 % /*
35 % ██████ ███████ █████ ██████ ███ ███ ███████
36 % ▄ ██ ▄██ ██ ██ ██ ██ ██ ██ ████ ████ ██
37 % ████ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
38 % ▀ ██ ▀██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
39 % ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
40 % */
41 %<*readme&main>
42 hu-berlin-bundle
43 ================
44
45 This package provides files according to the corporate design
46 for the Humboldt-Universität zu Berlin.
47 It is _no_ official package of the university itself and
48 not officially approved by it.
49
50 You find more information in the official [corporate design guideline](https://www.hu-berlin.de/de/hu-intern/design/basiselemente/leitfaden-corporate-design-hu.pdf)
51 and on the website <https://www.hu-berlin.de/de/hu-intern/design>.
52
53 ## Documents and Documentations for hu-berlin bundle
54
55
56 This bundle provides following files:
57
58 * `hu-berlin-bundle.dtx` which is the core file designed with literate programming
59 * `hu-berlin-bundle.ins` which is the installation file for all necessary files generated automatically
60 * `hu-berlin-bundle.pdf` is documentation of the bundle.
61 * `README.md`
62 * `makefile`
63
64 All other files can and will be generated from the `.dtx` file (see below).
65
66 Furthermore there is the folder `img` which contains the necessary image files.
67
68
69 This work has the LPPL maintenance status _maintained_.
70 The current maintainer of this work is [Lukas C. Bossert](https://github.com/lukascbossert).
71
72
73 You find this bundle versioned and available on [Zenodo](https://doi.org/10.5281/zenodo.3251728)
74
75 %</readme&main>
76 % /*
77 % ██ ██████ ███████ █████ ██████ ███ ███ ███████
78 % ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██
79 % ██ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
80 % ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
81 % ██ ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
82 % */
83 % /*
84 % ██████ ██ ██████
85 % ▄ ██ ▄██ ██ ██ ██ ██
86 % ████ ██████ ██ ██████
87 % ▀ ██ ▀██ ██ ██ ██ ██
88 % ██████ ██ ██████
89 % */
90 %<*bib>
91 %%
92 %% Encoding: UTF-8
93 %%
94 @InCollection{Hoare1973,
95 author = {Charles Antony Richard Hoare},
96 title = {Hints on programming language design},
97 editor = {C. Bunyan},
98 booktitle = {Computer Systems Reliability},
99 series = {State of the Art Report},
100 number = {20},
101 pages = {193--216},
102 date = {1973},
103 url={http://flint.cs.yale.edu/cs428/doc/HintsPL.pdf},
104 urldate={2018-09-06},
105 comment = {\blockcquote[195]{Hoare1973}{Documentation must be regarded as an integral part of the process of design and coding.
106 A good programming language will encourage and assist the programmer to write clear,
107 self-documenting code,
108 and even perhaps to develop
109 and display a pleasant style
110 of writing.}}
111 }
112
113 %</bib>
114 % /*
115 % ██ ██████ ██ ██████
116 % ██ ██ ██ ██ ██ ██
117 % ██ ██████ ██ ██████
118 % ██ ██ ██ ██ ██ ██
119 % ██ ██████ ██ ██████
120 % */
121 %<*internal>
122 \fi
123 \def\nameofplainTeX{plain}
124 \ifx\fmtname\nameofplainTeX\else
125 \expandafter\begingroup
126 \fi
127 %</internal>
128 % /*
129 % ██ ███ ██ ███████
130 % ▄ ██ ▄██ ████ ██ ██
131 % ████ ██ ██ ██ ██ ███████
132 % ▀ ██ ▀██ ██ ██ ██ ██
133 % ██ ██ ████ ███████
134 % */
135 %<*install>
136 %% \CharacterTable
137 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
138 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
139 %% Digits \0\1\2\3\4\5\6\7\8\9
140 %% Exclamation \! Double quote \" Hash (number) \#
141 %% Dollar \$ Percent \% Ampersand \&
142 %% Acute accent \' Left paren \( Right paren \)
143 %% Asterisk \* Plus \+ Comma \,
144 %% Minus \- Point \. Solidus \/
145 %% Colon \: Semicolon \; Less than \<
146 %% Equals \= Greater than \> Question mark \?
147 %% Commercial at \@ Left bracket \[ Backslash \\
148 %% Right bracket \] Circumflex \^ Underscore \_
149 %% Grave accent \` Left brace \{ Vertical bar \|
150 %% Right brace \} Tilde \~}
151
152 \input docstrip.tex
153 \keepsilent
154 \askforoverwritefalse
155
156 \nopreamble\nopostamble
157
158 \usedir{doc/latex/\jobname}
159 \generate{
160 \file{README.md}{\from{\jobname.dtx}{readme,main}}
161 \file{hu-berlin-bundle-bibliography.bib}{\from{\jobname.dtx}{bib}}
162 \file{hu-berlin-letter-example-lualatex.tex}{\from{\jobname.dtx}{example,letter}}
163 \file{hu-berlin-letter-example-markdown.md}{\from{\jobname.dtx}{example,letter-md}}
164 }
165
166 \preamble
167 ----------------------------------------------------------------
168 hu-berlin-bundle
169 Author: Lukas C. Bossert
170 E-mail: [email protected]
171 License: Released under the LaTeX Project Public License v1.3c or later
172 See: http://www.latex-project.org/lppl.txt
173 Various parts my have a different licence,
174 please consider and respect them carefully.
175 ----------------------------------------------------------------
176
177 \endpreamble
178 \postamble
179
180 Copyright (C) 2019-2023
181 \endpostamble
182
183 \usedir{tex/latex/\jobname}
184 \generate{
185 \file{hu-berlin-letter-example-lualatex.tex}{\from{\jobname.dtx}{example,letter}}
186 \file{hu-berlin-letter-example.lco}{\from{\jobname.dtx}{example,lco}}
187 \file{hu-berlin-letter.cls}{\from{\jobname.dtx}{cls,letter}}
188 %
189 \file{hu-berlin-base.sty}{\from{\jobname.dtx}{sty,base}}
190 \file{hu-berlin-bundle-style.sty}{\from{\jobname.dtx}{sty,style}}
191 \file{hu-berlin-letter-template.latex}{\from{\jobname.dtx}{template,letter-md}}
192 }
193 %</install>
194 %<install>\endbatchfile
195 %<*internal>
196 \usedir{source/latex/\jobname}
197 \generate{
198 \file{\jobname.ins}{\from{\jobname.dtx}{install}}
199 }
200 \ifx\fmtname\nameofplainTeX
201 \expandafter\endbatchfile
202 \else
203 \expandafter\endgroup
204 \fi
205 %</internal>
206 % /*
207 % ██ ██ ███ ██ ███████
208 % ██ ██ ████ ██ ██
209 % ██ ██ ██ ██ ██ ███████
210 % ██ ██ ██ ██ ██ ██
211 % ██ ██ ██ ████ ███████
212 % */
213 %<*driver>
214 \ProvidesFile{\jobname.dtx}
215 [\Version\space Documents and documentation for hu-berlin]
216 %</driver>
217 % /*
218 % ██████ ██████ ██████ ██████ ██ █████ ███████ ███████
219 % ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
220 % ██ ██ ██ ██ ██ ██ ██ ███████ ███████ ███████
221 % ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
222 % ██████ ██████ ██████ ██████ ███████ ██ ██ ███████ ███████
223 % */
224 %<*driver>
225 \def\huberlinsubject{Guideline}
226 \def\huberlinshort{hu-berlin-bundle}
227 \def\huberlintitle{%
228 Documents and Documentations for \LaTeX\ at the Humboldt-Universität zu Berlin (unofficial)}
229 \def\huberlinsubtitle{For Authors and Developers}
230 \def\huberlinauthor{Lukas C. Bossert}
231 \RequirePackage{scrlfile}
232 \PassOptionsToClass{%
233 english
234 ,oneside
235 }{scrbook}
236 \ReplaceClass{article}{scrbook}
237 \documentclass{ltxdoc}
238 \usepackage{hu-berlin-bundle-style}
239 \GetFileInfo{\jobname.dtx}
240 % /*
241 % ██████ ██████ ██████ ██ ██ ███ ███ ███████ ███ ██ ████████
242 % ▄ ██ ▄ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ████ ██ ██
243 % ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ █████ ██ ██ ██ ██
244 % ▀ ██ ▀ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
245 % ██████ ██████ ██████ ██████ ██ ██ ███████ ██ ████ ██
246 % */
247 \begin{document}
248 \openoutputfile{\jobname.pkglist}{pkglist}
249 \pdfbookmark[section]{\contentsname}{toc}
250 \tableofcontents
251 \clearpage
252 \chapter{Introduction}
253 \begin{markdown*}{hybrid=true}
254 %</driver>
255 % /*
256 % ██████ ███████ █████ ██████ ███ ███ ███████
257 % ▄ ██ ▄██ ██ ██ ██ ██ ██ ██ ████ ████ ██
258 % ████ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
259 % ▀ ██ ▀██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
260 % ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
261 % */
262 %<*readme,main>
263
264 With this (unofficial) bundle you have several documents which are designed according to the corporate design of the Humboldt-Universität zu Berlin.
265
266
267 Following documents or documentclasses are available:
268
269 * letter (`hu-berlin-letter.cls`); via `.tex` and `.md`
270 * base package (`hu-berlin-base.sty`)
271
272
273 ## Installation of the bundle
274 `hu-berlin` is part of the distributions [MiKTeX](http://www.miktex.org)
275 and [TeXLive](http://www.tug.org/texlive) -- thus, you
276 can easily install it using the respective package manager.
277 If you would like to
278 install `hu-berlin-bundle` into your local folder manually, do the following:
279 Go to your terminal, browse to the folder of this bundle and run
280
281 ```
282 make install
283 ```
284
285
286 If you are using macOS you might be asked for your user account password for the installation.
287
288
289 Further options of this makefile are:
290
291 * `clean`: deletes all unnecessary files
292 * `cleanbundle`: deletes all files except `.dtx`, `.md`. You will get the plain version of this bundle.
293 This might be helpful if you send the bundle to someone else.
294 * `ctan`: this will create a zip file which can be used to send to CTAN.
295 * `files`: will only create the files from the `.dtx`-scratch.
296 * `uninstall`: will erase the locally installed files.
297
298
299 This bundle is constantly updated. For hints, errors or suggestions use the GitHub repository [https://github.com/LukasCBossert/hu-berlin-bundle](https://github.com/LukasCBossert/hu-berlin-bundle).
300
301 ## Changelog
302
303 All notable changes to this project will be documented in the [README.md](https://github.com/LukasCBossert/hu-berlin-bundle/blob/master/README.md).
304 This project **does not** adhere to [Semantic Versioning](http://semver.org/).
305 The markdown syntax is inspired by the conventions proposed by [keepachangelog.com](http://keepachangelog.com/).
306
307 ### v1.1.2 (2023/05/14)
308 * (general) fix of deprecated command
309 make `make doc` runable again
310
311
312 ### v1.1.1 (2021/01/31)
313 * (letter) fix for language switch when using markdown-pandoc-conversion workflow
314
315
316 ### v1.1.0 (2021/01/31)
317 * (letter) language option now available also for the markdown-pandoc-conversion-workflow.
318
319 ### v1.0.9 (2021/01/10)
320 * (letter) making everything multi-lingual (at least German and English); German is default language. You can load English e.g. by `documentclass[english]{hu-berlin-letter}` (addresses [issue No. 3](https://github.com/LukasCBossert/hu-berlin-bundle/issues/3))
321
322
323 ### v1.0.8 (2020/10/30)
324 * (letter) replacing actual logo with a dummy text (due to possible copyright conflicts).
325 The correct logo has to be called `hu-berlin-logo.pdf`
326 and needs to be put somewhere in PATH so it will be found.
327 If such file cannot be found a dummy text will be taken instead (`Humboldt-Universität zu Berlin´)
328
329
330 ### v1.0.7 (2020/10/29)
331 * (letter) fixed missing `\removereffields`
332 * (letter) added missing suffix for hu-logo (`.pdf`)
333
334
335
336 ### v1.0.6 (2020-10-22)
337 * (letter) changed address separator
338 * (letter) fixed empty minipage when no metadata given
339 * (letter) changed default backaddress
340
341
342 ### v1.0.5 (2020-04-28)
343 * (general) Changed logo format to `.pdf`
344 * (letter) Changed `\ifkomavarempty` to `\ifkomavarempty`, fixes
345 [github-issue nr. 1](https://github.com/LukasCBossert/hu-berlin-bundle/issues/1)
346
347
348 ### v1.0.4 (2019-12-19)
349 * Added `hu-berlin-base.sty` as a package which contains all relevant code for documents and documentclasses of the bundle.
350
351 ### v1.0.3 (2019-06-26)
352 * Changed the main font for compatibility with UNIX-systems (TeX Gyre Heros instead of Verdana).
353
354 ### v1.0.2 (2019-06-22)
355 Renaming files for CTAN compatability.
356
357
358 ### v1.0.1 (2019-06-21)
359 Internal changes for publishing. Still one documentclass for a letter.
360
361 ### v1.0.0 (2019-06-21)
362 First release with a documentclass for letter.
363
364 ## Copyright
365 Various parts of this bundle have different copyrights.
366 If not otherwise stated the copyright is [The LaTeX project public license (LPPL), version 1.3c](https://www.latex-project.org/lppl/lppl-1-3c/)
367
368
369 ### Boilerplate / markdown-template
370 The template for the markdown conversion,
371 forked from the pandoc-templates and [JensErat pandoc-scrlttr2](https://github.com/JensErat/pandoc-scrlttr2) is dual-licensed,
372 under both the GPL (v2 or higher, same as pandoc) and the BSD 3-clause license (included below).
373
374 ----
375
376 Copyright (c) 2014, John MacFarlane\\
377 Copyright (c) 2014, Jens Erat\\
378 All rights reserved.
379
380 Redistribution and use in source and binary forms, with or without
381 modification, are permitted provided that the following conditions are met:
382
383 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
384
385 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
386
387 * Neither the name of John MacFarlane nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
388
389 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
390 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
391 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
392 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
393 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
394 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
395 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
396 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
397 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
398 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
399 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
400 %</readme,main>
401 % /*
402 % ██ ██████ ███████ █████ ██████ ███ ███ ███████
403 % ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██
404 % ██ ██████ █████ ███████ ██ ██ ██ ████ ██ █████
405 % ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
406 % ██ ██ ██ ███████ ██ ██ ██████ ██ ██ ███████
407 % */
408 %<*driver>
409 \end{markdown*}
410 \clearpage
411 \chapter{Preambel}
412
413 This bundle consists of various files
414 which are either generated by the core file (|.dtx|)
415 or are part of the basic structure of this bundle.
416 You can easily pick up the basic file structure from \cref{hu-berlin:bundle-structure}.
417
418 \begin{figure}[!htb]
419 \footnotesize
420 \dirtree{%
421 .1 \huberlinFolder hu-berlin-bundle.
422 .2 hu-berlin-bundle.dtx \DTcomment{code and documentation}.
423 .2 hu-berlin-bundle.pdf \DTcomment{documentation}.
424 .2 hu-berlin-base.sty \DTcomment{basic components of the bundle}.
425 .2 hu-berlin-letter-example-lualatex.tex \DTcomment{letter}.
426 .2 hu-berlin-letter-example.lco \DTcomment{datafile for letter}.
427 .2 hu-berlin-letter-example-lualatex.pdf \DTcomment{letter}.
428 .2 hu-berlin-letter-example-markdown.pdf \DTcomment{converted letter from markdown}.
429 .2 hu-berlin-letter-example-markdown.md \DTcomment{example markdown file }.
430 .2 hu-berlin-letter-template.latex \DTcomment{template for conversion}.
431 .2 \huberlinFolder img\DTcomment{folder for images}.
432 .3 texografie-logo.pdf\DTcomment{logo of maintainer}.
433 .2 makefile\DTcomment{makefile to generate all required files}.
434 .2 README.md\DTcomment{README file with information on installation}.
435 }
436 \caption{Structure of \texttt{hu-berlin} bundle}
437 \label{hu-berlin:bundle-structure}
438 \end{figure}
439
440 When you run the |makefile|
441 you get all these various files described above.
442
443
444
445
446 \DocInput{\jobname.dtx}
447
448 \printbibliography
449
450
451 \part{Example files}
452 \chapter{Letter}
453 \section{From \texttt{.tex}}
454 \IfFileExists{hu-berlin-letter-example-lualatex.pdf}
455 {\includepdf[%
456 pagecommand={\pagestyle{scrheadings}}
457 ,link
458 ,pages=-
459 % ,scale=.5
460 ,nup=2x1
461 ,frame]{hu-berlin-letter-example-lualatex.pdf}}
462 {|hu-berlin-letter-example-lualatex.pdf| missing!}
463
464 \section{From \texttt{.md}}
465 \IfFileExists{hu-berlin-letter-example-markdown.pdf}
466 {\includepdf[%
467 pagecommand={\pagestyle{scrheadings}}
468 ,link
469 ,pages=-
470 % ,scale=.5
471 ,nup=2x1
472 ,frame]{hu-berlin-letter-example-markdown.pdf}}
473 {|hu-berlin-letter-example-markdown.pdf| missing!}
474
475
476 \end{document}
477 %</driver>
478 % /*
479 % ██ ██████ ██████ ██████ ██ ██ ███ ███ ███████ ███ ██ ████████
480 % ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ████ ██ ██
481 % ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ █████ ██ ██ ██ ██
482 % ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
483 % ██ ██████ ██████ ██████ ██████ ██ ██ ███████ ██ ████ ██
484 % */
485 % /*
486 % ██████ ██████ ██████ ███████
487 % ██ ██ ██ ██ ██ ██
488 % █████ ██ ██ ██ ██ ██ █████ █████
489 % ██ ██ ██ ██ ██ ██
490 % ██████ ██████ ██████ ███████
491 % */
492 % \fi
493 %
494 % \part{Guideline for Users}
495 % \begin{macrocode}
496 %<*example>
497 % \end{macrocode}
498 % \chapter{Letter}
499 % We give an example on how to create a letter.
500 %
501 % \section{\texttt{.lco}-file}
502 % \begin{macrocode}
503 %<*lco>
504 % \end{macrocode}
505 % This is the file you load into your |.tex| letter.
506 % The information you provide here do normally not change from letter to letter.
507 % That’s why we put it in a separate file.
508 %
509 % The first line should provide this information.
510 % \begin{macrocode}
511 \ProvidesFile{hu-berlin-letter-example.lco}
512 % \end{macrocode}
513 % Now we set up the personal data.
514 %
515 % We start with the name of the sender.
516 % \begin{macrocode}
517 \setkomavar{fromname}
518 % \end{macrocode}
519 % you can also write the position of this person in brackets, this is optional;
520 % \oarg{position}
521 % \begin{macrocode}
522 [Wissenschaftlicher Mitarbeiter]
523 % \end{macrocode}
524 % But you need to give a name:
525 % \begin{macrocode}
526 {Dr. Max Mustermann}
527 % \end{macrocode}
528 % The mail address
529 % \begin{macrocode}
530 \setkomavar{fromemail}{[email protected]}
531 % \end{macrocode}
532 % For phone and fax number you only need to type the last digits.
533 % \begin{macrocode}
534 \setkomavar{fromphone}{1234}
535 % \end{macrocode}
536 % If you don’t have a fax (or a phone),
537 % leave it empty. Do \emph{not} delete it.
538 % \begin{macrocode}
539 \setkomavar{fromfax}{5678}
540 % \end{macrocode}
541 % And finally the URL.
542 % \begin{macrocode}
543 \setkomavar{fromurl}{www.hu-berlin.de}
544 % \end{macrocode}
545 % If your backaddress is to long
546 % – it will be set up automatically –
547 % you can redefine it.
548 %
549 % \begin{macrocode}
550 %% \setkomavar{backaddress}{HU Berlin\\
551 %% Unter den Linden 6\\
552 %% D-10099 Berlin}
553 % \end{macrocode}
554 % Selfexplaining: the faculty.
555 % \begin{macrocode}
556 \setkomavar{faculty}{%
557 Philosophische Fakultät
558 }
559 % \end{macrocode}
560 %
561 % \begin{macrocode}
562 \setkomavar{institute}{%
563 \mbox{Institut für Briefvorlagen}
564 }
565 % \end{macrocode}
566 % \begin{macrocode}
567 \setkomavar{institute.additional}{Here you can add more text.}
568 % \end{macrocode}
569 % \begin{macrocode}
570 \setkomavar{institute.head}[Dekanin]{Prof. Dr. Maike Musterfrau}
571 % \end{macrocode}
572 % \begin{macrocode}
573 \setkomavar{institute.head.mail}{[email protected]}
574 % \end{macrocode}
575 % \begin{macrocode}
576 \setkomavar{office}{%
577 Mohrenstraße 40/41\\
578 Zimmer X\\
579 D-10117 Berlin}
580 % \end{macrocode}
581 % \begin{macrocode}
582 \setkomavar{connections}{U Bahnhof Hausvogteiplatz (U2)}
583 % \end{macrocode}
584 % \begin{macrocode}
585 \setkomavar{accessibility}{Hausvogteiplatz}
586 % \end{macrocode}
587 % \begin{macrocode}
588 \setkomavar{signature}{%
589 \usekomavar{institute.head} --
590 \usekomavar{fromname}
591 }
592 % \end{macrocode}
593 % \begin{macrocode}
594 %</lco>
595 % \end{macrocode}
596 % \huberlinlisting%
597 % [listing options = {%
598 % ,linerange={18-48}
599 % ,numbers = left
600 % ,numbersep = 10pt
601 % ,numberstyle =\footnotesize\ttfamily\color{hu-berlin-grey}
602 % }]%
603 % {hu-berlin-letter-example.lco}
604 %
605 % \section{\texttt{.tex}-file}
606 % \begin{macrocode}
607 %<*letter>
608 % \end{macrocode}
609 % \begin{macrocode}
610 \documentclass{hu-berlin-letter}
611 % \end{macrocode}
612 % Now we load the personal data-file which has the ending |.lco|.
613 % \begin{macrocode}
614 \LoadLetterOption{hu-berlin-letter-example}
615 % \end{macrocode}
616 % If you have the HU font installed on your computer,
617 % you can load it, too:
618 % \begin{macrocode}
619 % \setmainfont[%
620 % BoldFont=ScalaSans-BoldLF,
621 % Numbers=OldStyle]{ScalaSans-RegularLF}
622 % \end{macrocode}
623 % Now following the reference information
624 % \begin{macrocode}
625 \setkomavar{myref}{}
626 % \end{macrocode}
627 % \begin{macrocode}
628 \setkomavar{yourref}{}
629 % \end{macrocode}
630 % \begin{macrocode}
631 \setkomavar{yourmail}{}
632 % \end{macrocode}
633 % \begin{macrocode}
634 \setkomavar{customer}{}
635 % \end{macrocode}
636 % \begin{macrocode}
637 \setkomavar{invoice}{}
638 % \end{macrocode}
639 % \begin{macrocode}
640 \setkomavar{subject}{Betreff}
641 % \end{macrocode}
642 % \begin{macrocode}
643 \usepackage{blindtext}
644 % \end{macrocode}
645 % We close the preamble and start the letter
646 % \begin{macrocode}
647 \begin{document}
648 % \end{macrocode}
649 % The address is written as \marg{address}
650 % \begin{macrocode}
651 \begin{letter}{%
652 % \end{macrocode}
653 % \begin{macrocode}
654 Erika Musterfrau\par
655 Musterweg 43\par
656 56789 Musterhausen%
657 % \end{macrocode}
658 % Closing now again.
659 % \begin{macrocode}
660 }
661 % \end{macrocode}
662 % \begin{macrocode}
663 \opening{Sehr geehrte Frau Musterfrau,}
664 % \end{macrocode}
665 % This is just some blindtext.
666 % \begin{macrocode}
667 \blindtext[2]
668 \clearpage
669 \blindtext
670 % \end{macrocode}
671 % Closing letter
672 % \begin{macrocode}
673 \closing{Mit freundlichen Grüßen}
674 % \end{macrocode}
675 % If you still have something to say/write.
676 % \begin{macrocode}
677 \ps PS: \dots
678 % \end{macrocode}
679 % Any amendment.
680 % \begin{macrocode}
681 \encl{%
682 Anlage 1\\
683 Anlage 2%
684 }
685 % \end{macrocode}
686 % This is the distribution
687 % \begin{macrocode}
688 \cc{%
689 Verteiler 1\\
690 Verteiler 2%
691 }
692 % \end{macrocode}
693 % That’s it. Done.
694 % \begin{macrocode}
695 \end{letter}
696 \end{document}
697 % \end{macrocode}
698 % And how does a example letter looks like?
699 % \huberlinlisting%
700 % [listing options = {%
701 % ,linerange={18-48}
702 % ,numbers = left
703 % ,numbersep = 10pt
704 % ,numberstyle =\footnotesize\ttfamily\color{hu-berlin-grey}
705 % }]%
706 % {hu-berlin-letter-example-lualatex.tex}
707 % \begin{macrocode}
708 %</letter>
709 % \end{macrocode}
710 % \section{Letter from markdown}
711 % \begin{macrocode}
712 %<*letter-md>
713 % \end{macrocode}
714 % You need to have |pandoc| installed on your computer.
715 % To create letters via markdown and |pandoc| run from the command line:
716 %
717 % \begin{warning}pandoc --pdf-engine=lualatex --template hu-berlin-letter-template.latex -o YOUR-FILE.pdf YOUR-FILE.md\end{warning}
718 % The |.md| file needs a section with metadata.
719 %
720 % It starts and ends with three |---|.
721 % All necessary metadata information are listed inbetween.
722 % \begin{macrocode}
723 ---
724 documentclass: hu-berlin-letter
725 % \end{macrocode}
726 % The following will load the |.lco|-file, you replace that with the name of your |.lco|-file.
727 % \begin{macrocode}
728 sender: hu-berlin-letter-example
729 % \end{macrocode}
730 % You should also tell a short subject
731 % \begin{macrocode}
732 subject: Short description
733 % \end{macrocode}
734 % And if you want to have a different language, define it now.
735 % You can choose between German (default)
736 % and English.
737 % \begin{macrocode}
738 lang: english
739 % \end{macrocode}
740 % The information for the addressee has to be written like this:
741 % \begin{macrocode}
742 addressee:
743 - Alexander von Humboldt
744 - Unter den Linden 6
745 - 10099 Berlin
746 % \end{macrocode}
747 % \begin{macrocode}
748 ---
749 % \end{macrocode}
750 % You find a list with possible options for this metadata information header below.
751 %
752 % Now the content of your letter
753 % \begin{macrocode}
754 Thank you very much for your letter.
755 % \end{macrocode}
756 % Let’s see how this example file looks like:
757 % \huberlinlisting%
758 % [listing options = {%
759 % ,numbers = left
760 % ,numbersep = 10pt
761 % ,numberstyle =\footnotesize\ttfamily\color{hu-berlin-grey}
762 % }]%
763 % {hu-berlin-letter-example-markdown.md}
764 % \begin{macrocode}
765 %</letter-md>
766 % \end{macrocode}
767 % Here we close the example files.
768 % \begin{macrocode}
769 %</example>
770 % \end{macrocode}
771 %\part{Guide for Coders}
772 % \begin{macrocode}
773 %<*sty>
774 % \end{macrocode}
775 %\chapter{hu-berlin-base-package}
776 % \begin{macrocode}
777 %<*base>
778 % \end{macrocode}
779 % Since we do want to compile with \lualatex,
780 % we make sure that it will be compilable only with that.
781 % \begin{macrocode}
782 \RequirePackage{ifluatex,luatex85}
783 % \end{macrocode}
784 % Now a fix.\fnurl{https://tex.stackexchange.com/a/75065}
785 % \begin{macrocode}
786 \ifx\directlua\relax
787 \let\directlua\UnDeFiNeD
788 \fi
789 % \end{macrocode}
790 % \begin{macrocode}
791 \ifluatex
792 \else
793 \GenericError{hu-berlin}%
794 {Please use `LuaLaTeX' as Compiler.^^J I abort here.}
795 \fi
796 % \end{macrocode}
797 % We do not need many packages.
798 % The ones we need are loaded now.
799 % \begin{macrocode}
800 \RequirePackage[english,ngerman]{babel}
801 % \end{macrocode}
802 % Common package for handling figures is \pkg{graphicx}.
803 % \begin{macrocode}
804 \RequirePackage{graphicx}
805 % \end{macrocode}
806 % For loading fonts.
807 % \begin{macrocode}
808 \RequirePackage{fontspec}
809 % \end{macrocode}
810 % Actually the corporate design says
811 % that the font Verdana should be used.
812 % But since this font is not included in
813 % UNIX-systems we use a derivative.
814 % \begin{macrocode}
815 \setmainfont{TeX Gyre Heros}
816 % \end{macrocode}
817 % If you have Verdana on your system
818 % you can uncomment the following line.
819 % \begin{macrocode}
820 % \setmainfont{Verdana}
821 % \end{macrocode}
822 % For the wheelchair symbol we load \pkg{marvosym}
823 % \begin{macrocode}
824 \RequirePackage{marvosym}
825 % \end{macrocode}
826 % And we define various colors from the corporate design manual.
827 % \begin{macrocode}
828 \RequirePackage{xcolor}
829 \definecolor{hu-berlin-blue}{RGB}{0,65,137}
830 \definecolor{hu-berlin-green}{RGB}{150,190,20}
831 \definecolor{hu-berlin-grey}{RGB}{169,169,169}
832 \definecolor{hu-berlin-brown}{RGB}{82,79,60}
833 \definecolor{hu-berlin-red}{RGB}{180,0,0}
834 % \end{macrocode}
835 % That’s all for the base package, so we close it.
836 % \begin{macrocode}
837 %</base>
838 % \end{macrocode}
839 % \begin{macrocode}
840 %</sty>
841 % \end{macrocode}
842 % \begin{macrocode}
843 %<*cls>
844 % \end{macrocode}
845 %\chapter{Letter}
846 % \begin{macrocode}
847 %<*letter>
848 % \end{macrocode}
849 % We load \pkg{scrlttr2} which is the documentclass for letters.
850 % Furthermore we set up some options.
851 % The default language is German. But all strings are also
852 % available for English. You can load English as option to the
853 % documentclass.
854 % \begin{macrocode}
855 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrlttr2}}
856 \DeclareOption{english}{\PassOptionsToPackage{ngerman,main=english}{babel}}
857 \DeclareOption{ngerman}{\PassOptionsToPackage{ngerman}{babel}}
858 \ExecuteOptions{ngerman}
859 \ProcessOptions\relax
860 % \end{macrocode}
861 % Now the documentclass itself.
862 % \begin{macrocode}
863 \LoadClass[%
864 fontsize=10pt,
865 version=last,
866 % \end{macrocode}
867 % If there is anything to debug, you can enable |visualize|
868 % \begin{macrocode}
869 % visualize
870 % \end{macrocode}
871 % \begin{macrocode}
872 ]{scrlttr2}
873 % \end{macrocode}
874 % For debugging also uncomment the \cs{showfields}\marg{fields} commanand.
875 % \begin{macrocode}
876 % \showfields{head,address,location,refline,foot}
877 % \end{macrocode}
878 % Since all common and basic features of the bundle
879 % are located in a separate package we load that first.
880 % \begin{macrocode}
881 \RequirePackage{hu-berlin-base}
882 % \end{macrocode}
883 % To get the HU logo on the second and following pages we load \pkg{scrlayer-scrpage}.\fnurl{https://tex.stackexchange.com/a/495258/98739}
884 % \begin{macrocode}
885 \RequirePackage{scrlayer-scrpage}
886 \clearpairofpagestyles
887 \DeclareNewLayer[
888 foreground,
889 voffset=\useplength{firstheadvpos},
890 hoffset=\useplength{firstheadhpos},
891 width=\useplength{firstheadwidth},
892 mode=picture,
893 contents=\putUL{\raisebox{-\height}{\usekomavar{firsthead}}}
894 ]{likefirstpage.head}
895 \AddLayersToPageStyle{scrheadings}{likefirstpage.head}
896 \DeclareNewLayer[
897 foreground,
898 align=r,
899 voffset=\useplength{locvpos},
900 hoffset=\paperwidth-\useplength{lochpos},
901 width=\useplength{locwidth},
902 height=\useplength{locheight},
903 contents=\usekomavar{nextlocation},
904 %pretocontents=\layercontentsmeasure% to show the position of the layer
905 ]{likefirstpage.loc}
906 \AddLayersToPageStyle{scrheadings}{likefirstpage.head,likefirstpage.loc}
907 % \end{macrocode}
908 % Now we apply the code for following pages.
909 % \begin{macrocode}
910 \newkomavar{nextlocation}
911 \setkomavar{nextlocation}{%
912 \raggedright
913 \fontsize{7}{8.5}\selectfont
914 \pagemark
915 }
916 % \end{macrocode}
917 % For better adjustments of the layout we load \pkg{geometry}.
918 % \begin{macrocode}
919 \RequirePackage{geometry}
920 \geometry{%
921 a4paper
922 ,left =25mm
923 ,bottom =16mm
924 ,foot =4mm
925 ,top =77mm
926 ,headheight =15pt
927 ,textwidth =117mm
928 ,marginparsep =0mm
929 ,marginparwidth =0mm
930 }
931 % \end{macrocode}
932 % Main Text and signature should be raggedright.
933 % \begin{macrocode}
934 \renewcommand*{\raggedsignature}{\raggedright}
935 \raggedright
936 % \end{macrocode}
937 % We also want to put the enclosures at the bottom of the page.\fnurl{https://tex.stackexchange.com/questions/77991/put-the-encl-at-the-bottom-of-the-page-lettre-class}
938 % \begin{macrocode}
939 \def\stopletter{}
940 \let\enclold\encl
941 \renewcommand\encl[1]{\vskip0ptplus1filll\enclold{#1}}
942 % \end{macrocode}
943 % We define new |komavar|s and we make it for
944 % German and for English as well.
945 % \begin{macrocode}
946 \providecaptionname{english}{\hubCCseparator}{Copy to}
947 \providecaptionname{english}{\hubEnclSeparator}{Attachment}
948 \providecaptionname{english}{\hubMyRef}{Reference:}
949 \providecaptionname{english}{\hubFromName}{Clerk:}
950 \providecaptionname{english}{\hubDate}{Date:}
951 \providecaptionname{english}{\hubAddress}{Postal address:}
952 \providecaptionname{english}{\hubConnections}{Public transport:}
953 \providecaptionname{english}{\hubOffice}{Office:}
954 \providecaptionname{english}{\hubBank}{Bank:}
955 \providecaptionname{english}{\hubOfficeHours}{Consultation hours:}
956 \providecaptionname{english}{\hubAccessibility}{Entrance:}
957 % \end{macrocode}
958 % Now for German.
959 % \begin{macrocode}
960 \providecaptionname{ngerman}{\hubCCseparator}{Kopie an}
961 \providecaptionname{ngerman}{\hubEnclSeparator}{Anlage}
962 \providecaptionname{ngerman}{\hubMyRef}{Geschäftszeichen:}
963 \providecaptionname{ngerman}{\hubFromName}{Bearbeiter:}
964 \providecaptionname{ngerman}{\hubDate}{Datum:}
965 \providecaptionname{ngerman}{\hubAddress}{Postanschrift:}
966 \providecaptionname{ngerman}{\hubConnections}{Verkehrsverbindungen:}
967 \providecaptionname{ngerman}{\hubOffice}{Sitz:}
968 \providecaptionname{ngerman}{\hubBank}{Bank:}
969 \providecaptionname{ngerman}{\hubOfficeHours}{Sprechzeiten:}
970 \providecaptionname{ngerman}{\hubAccessibility}{Eingang:}
971 % \end{macrocode}
972 % First the possibility to name the faculty,
973 % \begin{macrocode}
974 \newkomavar{faculty}
975 \newkomafont{faculty}{\bfseries\fontsize{8.5}{10}\selectfont}
976 % \end{macrocode}
977 % then the institute
978 % \begin{macrocode}
979 \newkomavar{institute}
980 \newkomafont{institute}{\fontsize{8.5}{10}\selectfont}
981 % \end{macrocode}
982 % and further fields for information.
983 % \begin{macrocode}
984 \newkomavar{institute.additional}
985 % \end{macrocode}
986 % We pass the name of the head of the institute.
987 % \begin{macrocode}
988 \newkomafont{institute.head}{\bfseries}
989 \newkomavar{institute.head}%
990 % \end{macrocode}
991 % Its position will be written as the optional argument.
992 %
993 % There is even the possibility to print the email-address onto the letter.
994 % \begin{macrocode}
995 \newkomavar{institute.head.mail}%
996 % \end{macrocode}
997 % Since there are many buildings with offices we tell where to find the sender
998 % \begin{macrocode}
999 \newkomavar{office}
1000 \setkomavar*{office}{\hubOffice}
1001 % \end{macrocode}
1002 % and how to get there.
1003 % \begin{macrocode}
1004 \newkomavar{connections}
1005 \setkomavar*{connections}{\hubConnections}
1006 % \end{macrocode}
1007 % Furthermore we inform about office hours
1008 % \begin{macrocode}
1009 \newkomavar{officehours}
1010 \setkomavar*{officehours}{\hubOfficeHours}
1011 % \end{macrocode}
1012 % and if there is accessibility for wheelchairs etc.
1013 % \begin{macrocode}
1014 \newkomavar{accessibility}
1015 \setkomavar*{accessibility}{{\large\reflectbox{\Wheelchair}} \hubAccessibility}
1016 % \end{macrocode}
1017 % \begin{macrocode}
1018 \newkomavar{bank}
1019 \setkomavar*{bank}{\hubBank}
1020 \setkomavar{bank}{Deutsche Bank PGK AG}
1021 \newkomavar{IBAN}
1022 \setkomavar{IBAN}{\mbox{IBAN DE95 1007 0848 0512 6206 01}}
1023 \newkomavar{BIC}
1024 \setkomavar{BIC}{BIC DEUTDEDB110}
1025 % \end{macrocode}
1026 % Now we set the location field,
1027 % which is the section on the right with additional information:
1028 % \begin{macrocode}
1029 \setkomavar{location}{%
1030 % \end{macrocode}
1031 % First anything regarding the font
1032 % \begin{macrocode}
1033 \raggedright
1034 \fontsize{7}{8.5}\selectfont
1035 % \begin{macrocode}
1036 % and for the section of faculty, institute etc. we use \env{minipage}
1037 % \begin{macrocode}
1038 \begin{minipage}[t][64mm]{\useplength{locwidth}}
1039 % \end{macrocode}
1040 % then the faculty
1041 % \begin{macrocode}
1042 \Ifkomavarempty{faculty}
1043 % \end{macrocode}
1044 % This is a fake space to avoid any trouble
1045 % if no custom metadata are given.
1046 % \begin{macrocode}
1047 {\hspace*{1em}}
1048 {\usekomafont{faculty}%
1049 \usekomavar{faculty}\\[1\baselineskip]}
1050 % \end{macrocode}
1051 % and the institute.
1052 % \begin{macrocode}
1053 \Ifkomavarempty{institute}
1054 {}
1055 {\usekomafont{institute}\usekomavar{institute}\\[1\baselineskip]}
1056 % \end{macrocode}
1057 % Now anything else regarding the institute.
1058 % \begin{macrocode}
1059 \Ifkomavarempty{institute.additional}
1060 {}
1061 {\usekomavar{institute.additional}\\[1\baselineskip]}
1062 % \end{macrocode}
1063 % What follows is the head of institute and its position name.
1064 % \begin{macrocode}
1065 \Ifkomavarempty{institute.head}
1066 {}
1067 {{\usekomafont{institute.head}%
1068 \usekomavar{institute.head}}\\%
1069 \usekomavar*{institute.head}}
1070 % \end{macrocode}
1071 % We close this section and the minipage.
1072 % \begin{macrocode}
1073 \end{minipage}
1074 % \end{macrocode}
1075 % Let’s turn to further information.
1076 %
1077 % For example date:
1078 % \begin{macrocode}
1079 \textbf{\usekomavar*{date}}\\
1080 \usekomavar{date}\par
1081 % \end{macrocode}
1082 % and the sender of the letter.
1083 % \begin{macrocode}
1084 \Ifkomavarempty{fromname}
1085 {}
1086 {\textbf{\usekomavar*{fromname}}\\
1087 \usekomavar{fromname}\par}
1088 % \end{macrocode}
1089 % And the reference of correspondence.
1090 % \begin{macrocode}
1091 \Ifkomavarempty{myref}
1092 {}
1093 {\textbf{\usekomavar*{myref}}\\
1094 \usekomavar{myref}\par}
1095 % \end{macrocode}
1096 % To complete this template we provide the possibility to name further reference fields.
1097 % \begin{macrocode}
1098 \Ifkomavarempty{yourref}
1099 {}
1100 {\textbf{\usekomavar*{yourref}}\\
1101 \usekomavar{yourref}\par}
1102 % \end{macrocode}
1103 % \begin{macrocode}
1104 \Ifkomavarempty{yourmail}
1105 {}
1106 {\textbf{\usekomavar*{yourmail}}\\
1107 \usekomavar{yourmail}\par}
1108 % \end{macrocode}
1109 % \begin{macrocode}
1110 \Ifkomavarempty{customer}
1111 {}
1112 {\textbf{\usekomavar*{customer}}\\
1113 \usekomavar{customer}\par}
1114 % \end{macrocode}
1115 % \begin{macrocode}
1116 \Ifkomavarempty{invoice}
1117 {}
1118 {\textbf{\usekomavar*{invoice}}\\
1119 \usekomavar{invoice}\par}
1120 % \end{macrocode}
1121 % \begin{macrocode}
1122 \textbf{\usekomavar*{fromaddress}}\\
1123 \usekomavar{fromaddress}
1124 \Ifkomavarempty{fromphone}
1125 {\par}
1126 {\\\usekomavar*{fromphone}\usekomavar{fromphone}
1127 \Ifkomavarempty{fromfax}
1128 {\par}
1129 {\\}}
1130 \Ifkomavarempty{fromfax}
1131 {}
1132 {\usekomavar*{fromfax}\usekomavar{fromfax}\par}
1133 % \end{macrocode}
1134 % Next, emails and url:
1135 % \begin{macrocode}
1136 \Ifkomavarempty{institute.head.mail}
1137 {}
1138 {\usekomavar{institute.head.mail}
1139 \Ifkomavarempty{fromemail}
1140 {\Ifkomavarempty{fromurl}
1141 {\par}
1142 {\\}}
1143 {\\}}
1144 % \end{macrocode}
1145 %
1146 % \begin{macrocode}
1147 \Ifkomavarempty{fromemail}
1148 {}
1149 {\usekomavar{fromemail}
1150 \Ifkomavarempty{fromurl}
1151 {\par}
1152 {\\}}
1153 % \end{macrocode}
1154 %
1155 % \begin{macrocode}
1156 \Ifkomavarempty{fromurl}
1157 {}
1158 {\usekomavar{fromurl}\par}
1159 % \end{macrocode}
1160 % Now the actual location of the sender
1161 % \begin{macrocode}
1162 \Ifkomavarempty{office}
1163 {}
1164 {\textbf{\usekomavar*{office}}\\
1165 \usekomavar{office}\par}
1166 % \end{macrocode}
1167 % The last information section should be pinned to the bottom.
1168 % \begin{macrocode}
1169 \vfill
1170 % \end{macrocode}
1171 % Inform your addressee about the connection possibilities.
1172 % \begin{macrocode}
1173 \Ifkomavarempty{connections}
1174 {}
1175 {\textbf{\usekomavar*{connections}}\\
1176 \usekomavar{connections}\par}
1177 % \end{macrocode}
1178 % \begin{macrocode}
1179 \Ifkomavarempty{officehours}
1180 {}
1181 {\textbf{\usekomavar*{officehours}}\\
1182 \usekomavar{officehours}\par}
1183 % \end{macrocode}
1184 % If there is a barrier free entrance, tell it.
1185 % \begin{macrocode}
1186 \Ifkomavarempty{accessibility}
1187 {}
1188 {\textbf{\usekomavar*{accessibility}}\\
1189 \usekomavar{accessibility}\par}
1190 % \end{macrocode}
1191 % And last the bank connection
1192 % \begin{macrocode}
1193 \Ifkomavarempty{bank}
1194 {}
1195 {\textbf{\usekomavar*{bank}}\\
1196 \usekomavar{bank}\\
1197 \usekomavar{IBAN}\\
1198 \usekomavar{BIC}
1199 }
1200 % \end{macrocode}
1201 % Finally we close \cs{setkomavar}\marg{location}
1202 % \begin{macrocode}
1203 }
1204 % \end{macrocode}
1205 % To fulfill the Corporate Design rules we adjust a few things.
1206 % \begin{macrocode}
1207 \KOMAoptions{%
1208 numericaldate =true
1209 ,refline =nodate
1210 ,backaddress =plain
1211 ,parskip =half-
1212 }
1213 % \end{macrocode}
1214 % Getting rid of all other fields and their default position.
1215 % \begin{macrocode}
1216 \removereffields
1217 % \end{macrocode}
1218 % Redefining length.
1219 % \begin{macrocode}
1220 \setplength{refvpos}{110mm}
1221 \setplength{refaftervskip}{0pt}
1222 \setplength{toaddrhpos}{25mm}
1223 \setplength{firstheadhpos}{\useplength{toaddrhpos}}
1224 \setplength{lochpos}{15mm}
1225 \setplength{locvpos}{\useplength{toaddrvpos}}
1226 \addtoplength{locvpos}{.75\baselineskip}
1227 \setplength{locwidth}{45mm}
1228 \setplength{locheight}{232mm}
1229 % \end{macrocode}
1230 % Now resetting or pre-defining some variables.
1231 %
1232 % First we set the head of the first page,
1233 % which is the logo.
1234 % Be sure that you have the right using it!
1235 % Everything regarding the logo is defined in
1236 % the corporate design guidlines.\fnurl{https://www.hu-berlin.de/de/hu-intern/design/basiselemente/leitfaden-corporate-design-hu.pdf}
1237 % You need to have the actual logo of the Humboldt-Universität zu Berlin which has to be called |hu-berlin-logo.pdf|.
1238 % It can be downloaded here: \url{http://zope.hu-berlin.de/hu-intern/design/downloads/logo}
1239 % If this logo is not found a replacement text is shown instead.
1240 % \begin{macrocode}
1241 \setkomavar{firsthead}{%
1242 \IfFileExists{hu-berlin-logo.pdf}
1243 {\includegraphics[width=145mm]{hu-berlin-logo.pdf}}
1244 {{\vspace*{2em}\hfil\scshape [humboldt-universität zu berlin]}}%
1245 }
1246 % \end{macrocode}
1247 %
1248 % \begin{macrocode}
1249 \setkomavar{backaddressseparator}{~\textbar~}
1250 % \end{macrocode}
1251 %
1252 % \begin{macrocode}
1253 \setkomavar{fromphone}{0000}
1254 \setkomavar*{fromphone}{Telefon +49 [30] 2093–}
1255 % \end{macrocode}
1256 %
1257 % \begin{macrocode}
1258 \setkomavar{fromfax}{0000}
1259 \setkomavar*{fromfax}{Telefax +49 [30] 2093–}
1260 % \end{macrocode}
1261 %
1262 % \begin{macrocode}
1263 \setkomavar*{fromaddress}{\hubAddress}
1264 \setkomavar{fromaddress}{%
1265 Humboldt-Universität zu Berlin\\
1266 Unter den Linden 6\\
1267 D-10099 Berlin}
1268 % \end{macrocode}
1269 % The default backaddress is slightly changed:
1270 % \begin{macrocode}
1271 \setkomavar{backaddress}{%
1272 Humboldt-Universität zu Berlin\\
1273 UdL 6\\
1274 D-10099 Berlin}
1275 % \end{macrocode}
1276 %
1277 % \begin{macrocode}
1278 \setkomavar*{date}{\hubDate}
1279 % \end{macrocode}
1280 %
1281 % \begin{macrocode}
1282 \setkomavar*{fromname}{\hubFromName}
1283 % \end{macrocode}
1284 %
1285 % \begin{macrocode}
1286 \setkomavar*{myref}{\hubMyRef}
1287 % \end{macrocode}
1288 % \begin{macrocode}
1289 \setkomavar*{enclseparator}{\hubEnclSeparator}
1290 % \end{macrocode}
1291 % \begin{macrocode}
1292 \setkomavar*{ccseparator}{\hubCCseparator}
1293 % \end{macrocode}
1294 % \begin{macrocode}
1295 % \RequirePackage{hyperref}
1296 % \AtBeginDocument{{
1297 % \usekomavar[\def\author]{fromname}
1298 % \usekomavar[\def\subject]{subject}
1299 % \hypersetup{%
1300 % pdftitle = {\subject},
1301 % pdfauthor = {\author},
1302 % pdfsubject = {\subject},
1303 % pdfkeywords = {\author, \subject},
1304 % pdflang = de,
1305 % pdfdisplaydoctitle = true,
1306 % colorlinks = true,
1307 % plainpages = false,
1308 % hypertexnames = false,
1309 % unicode,
1310 % }
1311 % }}
1312 % \end{macrocode}
1313 % \begin{macrocode}
1314 %</letter>
1315 % \end{macrocode}
1316 % \begin{macrocode}
1317 %</cls>
1318 % \end{macrocode}
1319 % \begin{macrocode}
1320 %<*template>
1321 % \end{macrocode}
1322 % \chapter{Boilerplate / Template for letters }
1323 % \begin{macrocode}
1324 %<*letter-md>
1325 % \end{macrocode}
1326 % Defining the documentclass and the language, too.
1327 % \begin{macrocode}
1328 \documentclass[
1329 $if(lang)$$lang$$else$german$endif$
1330 ]{hu-berlin-letter}
1331 % \end{macrocode}
1332 % We predefine two variables.
1333 % \begin{macrocode}
1334 \newkomavar{opening}
1335 \newkomavar{closing}
1336 \setkomavar{opening}{Sehr geehrte Damen und Herren}
1337 \setkomavar{closing}{Mit freundlichen Grüßen}
1338 % \end{macrocode}
1339 % \begin{macrocode}
1340 $for(letteroption)$
1341 \LoadLetterOption{$letteroption$}
1342 $endfor$
1343 $if(sender)$\LoadLetterOption{$sender$}$endif$
1344 $if(addresseeimage)$\setkomavar{addresseeimage}{$addresseeimage$}$endif$
1345 $if(backaddress)$\setkomavar{backaddress}{$backaddress$}\KOMAoptions{backaddress=true}$endif$
1346 $if(fromalign)$\KOMAoptions{fromalign=$fromalign$}$endif$
1347 $if(customer)$\setkomavar{customer}{$customer$}$endif$
1348 $if(date)$\setkomavar{date}{$date$}$endif$
1349 $if(fromaddress)$\setkomavar{fromaddress}{$fromaddress$}$endif$
1350 $if(frombank)$\setkomavar{frombank}{$frombank$}$endif$
1351 $if(fromemail)$\setkomavar{fromemail}{$fromemail$}\KOMAoptions{fromemail=true}$endif$
1352 $if(fromfax)$\setkomavar{fromfax}{$fromfax$}\KOMAoptions{fromfax=true}$endif$
1353 $if(fromlogo)$\setkomavar{fromlogo}{$fromlogo$}\KOMAoptions{fromlogo=true}$endif$
1354 $if(frommobilephone)$\setkomavar{frommobilephone}{$frommobilephone$}\KOMAoptions{frommobilephone=true}$endif$
1355 $if(fromname)$\setkomavar{fromname}{$fromname$}$endif$
1356 $if(fromphone)$\setkomavar{fromphone}{$fromphone$}\KOMAoptions{fromphone=true}$endif$
1357 $if(fromurl)$\setkomavar{fromurl}{$fromurl$}\KOMAoptions{fromurl=true}$endif$
1358 $if(fromzipcode)$\setkomavar{fromzipcode}{$fromzipcode$}$endif$
1359 $if(invoice)$\setkomavar{invoice}{$invoice$}$endif$
1360 $if(location)$\setkomavar{location}{$location$}$endif$
1361 $if(myref)$\setkomavar{myref}{$myref$}$endif$
1362 $if(myrefname)$\setkomavar*{myref}{$myrefname$}$endif$
1363 $if(place)$\setkomavar{place}{$place$}$endif$
1364 $if(PPcode)$\setkomavar{PPcode}{$PPcode$}$endif$
1365 $if(signature)$\setkomavar{signature}{$signature$}$endif$
1366 $if(specialmail)$\setkomavar{specialmail}{$specialmail$}$endif$
1367 $if(subject)$\setkomavar{subject}{$subject$}$endif$
1368 $if(title)$\setkomavar{title}{$title$}$endif$
1369 $if(yourmail)$\setkomavar{yourmail}{$yourmail$}$endif$
1370 $if(yourref)$\setkomavar{yourref}{$yourref$}$endif$
1371 $if(opening)$\setkomavar{opening}{$opening$}$endif$
1372 $if(closing)$\setkomavar{closing}{$closing$}$endif$
1373 $if(firstfoot)$\setkomavar{firstfoot}{$firstfoot$}$endif$
1374 % \end{macrocode}
1375 % Ok, let’s sum up the possible options you can use to pass data to the letter:
1376 % \begin{itemize} \item addresseeimage \item backaddress \item customer \item date \item fromaddress \item frombank \item fromemail \item fromfax \item fromlogo \item frommobilephone \item fromname \item fromphone \item fromurl \item fromzipcode \item invoice \item location \item myref \item myrefname \item place \item PPcode \item signature \item specialmail \item subject \item title \item yourmail \item yourref \item opening \item closing \item firstfoot \end{itemize}
1377 % Sometimes you might not have an addressee – we are checking this, too.
1378 % \begin{macrocode}
1379 $if(addressee)$
1380 $else$
1381 \KOMAoptions{addrfield=false}
1382 $endif$
1383 % \end{macrocode}
1384 % Now the actual content of the letter
1385 % \begin{macrocode}
1386 \begin{document}
1387 \begin{letter}{%
1388 $for(addressee)$
1389 $addressee$$sep$\\
1390 $endfor$
1391 }
1392 $for(include-before)$
1393 $include-before$
1394 $endfor$
1395 \opening{\usekomavar{opening}}
1396 $body$
1397 \closing{\usekomavar{closing}}
1398 $if(ps)$\ps{$ps$}$endif$
1399 $if(encl)$\encl{$encl$}$endif$
1400 $for(include-after)$$include-after$$endfor$
1401 \end{letter}
1402 \end{document}
1403 % \end{macrocode}
1404 % \begin{macrocode}
1405 %</letter-md>
1406 %</template>
1407 % \end{macrocode}
1408 %\chapter{Documentation preamble \param{style}}
1409 % \begin{macrocode}
1410 %<*sty>
1411 %<*style>
1412 \makeatletter
1413 \addtolength\marginparwidth{-40pt}
1414 \addtolength\marginparsep{4mm}
1415 \addtolength\oddsidemargin{-20pt}
1416 \addtolength\evensidemargin{-20pt}
1417 \let\PrintDescribeMacro=\@gobble
1418 \let\PrintDescribeEnv=\@gobble
1419 % \def\Describe@Macro#1{\endgroup
1420 % %\marginnote{\PrintDescribeMacro{#1}}%
1421 % \SpecialUsageIndex{#1}\@esphack\ignorespaces%
1422 % }
1423 %\def\Describe@Env#1{\endgroup
1424 % %\marginnote{\PrintDescribeEnv{#1}}%
1425 % \SpecialEnvIndex{#1}\@esphack\ignorespaces%
1426 % }
1427 \makeatother
1428 \AtBeginDocument{\normalmarginpar}
1429 \setlength\MacrocodeTopsep{.5\baselineskip}
1430 \setlength\MacroIndent{6mm}
1431
1432
1433 \RequirePackage{luatexbase}
1434 \RequirePackage[ngerman,english]{babel}
1435 \RequirePackage{calc}
1436
1437 \RequirePackage[
1438 paper = a4paper, % - use A4 paper size
1439 foot = 2cm,
1440 inner = 3cm, % - total body: left margin (odd pages)
1441 top = 3cm, % - total body: top margin
1442 outer = 3cm, % - total body: right margin (odd pages)
1443 bottom = 3cm, % - total body: bottom margin
1444 marginparwidth = 2cm, % - width for side note
1445 marginparsep = .5cm, % - space between notes and body text (content)
1446 % showframe,
1447 ]{geometry}
1448
1449 \newlength\fullwidth
1450 \setlength\fullwidth{\textwidth+\marginparwidth+\marginparsep}
1451
1452 \KOMAoptions{
1453 numbers = noenddot,
1454 }
1455 \AtBeginDocument{
1456 \KOMAoptions{
1457 % headwidth = {\fullwidth},
1458 % footwidth = {\fullwidth},
1459 footheight = 20pt,
1460 headheight = 29pt,
1461 captions = tableheading,
1462 }}
1463
1464
1465
1466 \title{\huberlintitle}
1467 %\subtitle{\huberlinsubtitle}
1468 \author{\huberlinauthor}
1469 \date{\Version}
1470
1471
1472 %---- Required Packages
1473 \RequirePackage{ifluatex,luatex85}
1474 \ifx\directlua\relax
1475 \let\directlua\UnDeFiNeD
1476 \fi
1477 \ifluatex
1478 \else
1479 \GenericError{hu-berlin}%
1480 {Please use `LuaLaTeX' as Compiler.^^J I abort here.}
1481 \fi
1482 % \end{macrocode}
1483 % For fonts we load the package \pkg{fontspec} which
1484 % has almost no limits handling font-stuff.
1485 % \begin{macrocode}
1486 \RequirePackage{fontspec}
1487 % \end{macrocode}
1488 % \begin{macrocode}
1489 \RequirePackage[mono=false]{libertine}
1490 \RequirePackage{amssymb}
1491
1492 \defaultfontfeatures{%
1493 Ligatures = TeX
1494 }
1495 % \end{macrocode}
1496 % For fonts we use the available |TeX Gyre Pagella| as main font.\fnurl{http://www.gust.org.pl/projects/e-foundry/tex-gyre}
1497 % \begin{macrocode}
1498 \setmainfont[%
1499 Ligatures = TeX
1500 ,Numbers = OldStyle]{TeX Gyre Pagella}
1501 % \end{macrocode}
1502 % And we declare also the other fonts, too.
1503 % \begin{macrocode}
1504 \setmonofont[%
1505 Scale=1
1506 ]{TeX Gyre Cursor}
1507 \setsansfont[%
1508 ,LetterSpace = .8
1509 ]{TeX Gyre Adventor-Regular}
1510 \linespread{1.05}
1511 % \end{macrocode}
1512 % \begin{macrocode}
1513
1514
1515
1516 \RequirePackage{marginnote}
1517 \renewcommand*{\marginfont}{%
1518 \rule{0pt}{0.7\baselineskip}%
1519 \footnotesize%
1520 \color{hu-berlin-brown}}
1521
1522 \RequirePackage[
1523 german = guillemets,
1524 style = german,
1525 ]{csquotes}
1526
1527 \RequirePackage{enumitem}
1528 \setlist{
1529 nosep,
1530 % itemindent=1em,
1531 % labelindent=0.5\parindent,
1532 leftmargin=*}
1533 \newlist{tabitemize}{itemize}{2}% neue Listenumgebung
1534 \setlist[tabitemize]{%
1535 nosep,
1536 leftmargin=*
1537 }
1538 \setlist[tabitemize,1]{label=\labelitemi}
1539 \setlist[tabitemize,2]{label=\labelitemii}
1540
1541
1542 \clubpenalty=10000 % prevent single lines at the beginning of a paragraph (Schusterjungen)
1543 \widowpenalty=10000 % prevent single lines at the end of a paragraph (Hurenkinder)
1544 \displaywidowpenalty=10000 %
1545
1546 \RequirePackage{pdfpages}
1547 \RequirePackage{biblatex}
1548 \addbibresource{\jobname-bibliography.bib}
1549 \addbibresource{\jobname-ctan.bib}
1550 \RequirePackage{ccicons} %creative commons
1551 \RequirePackage{xparse}
1552 \RequirePackage{ragged2e}
1553 \RequirePackage{microtype}
1554 \RequirePackage{xspace}
1555 \RequirePackage{graphicx}
1556 \graphicspath{{img/}}
1557 % \end{macrocode}
1558 % \begin{macrocode}
1559 \RequirePackage{etoolbox}
1560 %https://tex.stackexchange.com/a/235881/98739
1561 \AfterEndPreamble{%
1562 \maketitle
1563 \renewcommand\MacroFont{\ttfamily}
1564 \renewcommand\AltMacroFont{\ttfamily\linespread{.8}}% slanted verbatim
1565 }
1566
1567 % https://tex.stackexchange.com/a/401466/98739
1568 \makeatletter
1569 \renewcommand*{\maketitle}{%
1570 % taken and shortened from /usr/share/texmf/tex/latex/koma-script/scrartcl.cls
1571 \begin{titlepage}
1572 \newgeometry{left=3cm,right=3cm,top=1.5cm,bottom=2cm}
1573 \global\@topnum=\z@
1574 \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
1575 \null
1576 {\large\@author\hfill \href{mailto:[email protected]}{[email protected]}\par}
1577 \vskip 10em%
1578 {\begin{center}\color{hu-berlin-blue}
1579 {\fontsize{50}{55}\selectfont\huberlinshort{} \par\vskip .5em%
1580 \Large\sffamily\@title}\par
1581 \vskip .5em
1582 \end{center}}%
1583 {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}%
1584 \null\vskip 5em%
1585 \blockcquote[195]{Hoare1973}{Documentation must be regarded as an integral part of the process of design and coding.
1586 A good programming language will encourage and assist the programmer to write clear,
1587 self-documenting code,
1588 and even perhaps to develop
1589 and display a pleasant style
1590 of writing.}
1591 \null\vfill
1592 {\usekomafont{subtitle}{\@date \hfill
1593 \includegraphics[width=4cm]{img/texografie-logo.pdf}\\}}%
1594 \par
1595 \vskip 0em
1596 \restoregeometry
1597 \end{titlepage}
1598 }%
1599 \makeatother
1600
1601 \RequirePackage{xcolor}
1602 \definecolor{hu-berlin-blue}{RGB}{0,65,137} % HEX 004189
1603 \definecolor{hu-berlin-green}{RGB}{150,190,20} % HEX 93C11A % Topoi
1604 \definecolor{hu-berlin-grey}{RGB}{169,169,169}
1605 \definecolor{hu-berlin-brown}{RGB}{82,79,60}
1606 \definecolor{hu-berlin-red}{RGB}{180,0,0}
1607
1608
1609 \RequirePackage{dirtree}
1610 \renewcommand*\DTstylecomment{%
1611 \color{hu-berlin-grey}%
1612 \footnotesize%
1613 \sffamily}
1614 \renewcommand*\DTstyle{%
1615 \ttfamily%
1616 \small%
1617 }
1618
1619 \RequirePackage[
1620 markcase = noupper,
1621 footsepline = .5pt,
1622 % headsepline = .5pt,
1623 autooneside = false,% use left and right marks with a onesided document
1624 automark,% set \leftmark and \rightmark automatically by *\section and \subsection
1625 draft = false,
1626 ]{scrlayer-scrpage}
1627
1628 \pagestyle{scrheadings}
1629 \clearpairofpagestyles
1630 \rofoot*{\thepage}
1631 \lofoot*{\textcolor{hu-berlin-blue}{\huberlintitle}\ \vrule\ \textcolor{hu-berlin-brown}{\huberlinsubtitle}}
1632 \rohead*{hu-berlin-bundle}
1633 \lohead*{Version: \Version}
1634 % \end{macrocode}
1635 % \begin{macrocode}
1636 % https://tex.stackexchange.com/a/352925/98739
1637 \newcommand*\partnumber{}
1638 \DeclareNewLayer[
1639 background,
1640 textarea,
1641 addwidth=\marginparsep+\marginparwidth,
1642 mode=picture,
1643 contents={%
1644 \putC{\makebox[0pt][c]{\raisebox{-.5\height}{\scalebox{50}{\textcolor{black!5}{\partnumber}}}}}\gdef\partnumber{}%
1645 }
1646 ]{partnumber}
1647 \DeclareNewPageStyleByLayers{part}{partnumber}
1648 \renewcommand\partpagestyle{part}
1649 \renewcommand*{\partformat}{\gdef\partnumber{\thepart}}
1650
1651 % only a dirty workaround for the part title
1652 \newcommand*\changedpartwidth[1]{%
1653 \makebox[\linewidth][l]{%
1654 \parbox{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}{\raggedpart#1}%
1655 }%
1656 }
1657 % add \changedpartwidth as last command to the settings for font element part
1658 \addtokomafont{part}{\Huge\changedpartwidth}
1659
1660
1661
1662 %-https://tex.stackexchange.com/a/339516/98739 | https://tex.stackexchange.com/a/96722/98739
1663 % footnotes in the footer:
1664 \deffootnote%
1665 %[\normalparindent]%<width of mark>
1666 {0.0cm}%<indent of footnote text>
1667 {\normalparindent}%<paragraph indent in the footnote text>
1668 {\makebox[\normalparindent][r]%
1669 {\thefootnotemark\hspace*{3pt}}}%<definition of mark>
1670 \newlength{\normalparindent}
1671 \AtBeginDocument{\setlength{\normalparindent}{\parindent}}
1672 \setfootnoterule{0pt}% Kein Fußnotenstrich
1673 %\setfootnoterule[<height>]{<length>}
1674
1675 % \end{macrocode}
1676 % This will put the numbers of the chapters and sections into the margin.
1677 % \begin{macrocode}
1678 \renewcommand\sectionlinesformat[4]{%
1679 \makebox[0pt][r]{#3}#4%
1680 }
1681 % \end{macrocode}
1682 % \begin{macrocode}
1683 \RequirePackage{url}
1684 % \urlstyle{same}
1685
1686 \setkomafont{title}{\sffamily\color{hu-berlin-blue}\flushleft\bfseries}
1687 \setkomafont{disposition}{\color{hu-berlin-brown}\sffamily\bfseries\large}
1688 \setkomafont{section}{\usekomafont{disposition}}
1689 \setkomafont{subsection}{\usekomafont{disposition}}
1690 \setkomafont{subsubsection}{\usekomafont{disposition}}
1691 % \setkomafont{paragraph}{\bfseries}
1692 % \setkomafont{subsubsection}{\sffamilybold}
1693 \setkomafont{subtitle}{\large\color{hu-berlin-brown}\sffamily\flushleft}
1694 \setkomafont{pageheadfoot}{\footnotesize\sffamily\color{hu-berlin-grey}}
1695 \setkomafont{descriptionlabel}{\bfseries}
1696 \setkomafont{footnotelabel}{\bfseries}
1697 \addtokomafont{titlehead}{\flushright}
1698 % \setkomafont{headsepline}{\color{hu-berlin-blue}}
1699 %\setkomafont{marginnote}{\MakeUppercase\color{hu-berlin-brown}}
1700 \addtokomafont{caption}{\scriptsize}
1701 \setkomafont{captionlabel}{\bfseries\sffamily}
1702 \setkomafont{subject}{\bfseries\sffamily}
1703 \setcapindent{0pt}
1704
1705 \raggedbottom
1706
1707 \RequirePackage{listings}
1708 \PassOptionsToPackage{final}{listings}
1709 \RequirePackage[%
1710 skins
1711 ,listings
1712 ,breakable
1713 ,xparse
1714 ,documentation
1715 ]{tcolorbox}
1716 \lstMakeShortInline[language=TeX,basicstyle=\ttfamily]|
1717 % \end{macrocode}
1718 % Following we load \pkg{hyperxmp} and \pkg{hyperref} for \pdf-meta data and interactive linked text.
1719 % \begin{macrocode}
1720 \RequirePackage{hyperxmp}
1721 \RequirePackage{hyperref}
1722 \hypersetup{% setup the hyperref-package options
1723 unicode = true,
1724 pdfauthor = {hu-berlin}, % - author (PDF meta)
1725 pdfauthortitle = {},
1726 pdfcopyright = {Copyright (c) \the\year . All rights reserved.},
1727 pdfhighlight = /N,
1728 pdfdisplaydoctitle = true,
1729 pdflang = {},%de en
1730 pdfcaptionwriter = {Lukas C. Bossert},
1731 pdfkeywords = {hu-berlin},
1732 pdfencoding = auto,
1733 pdfproducer = {hu-berlin with LuaLaTeX},
1734 bookmarksnumbered = true,
1735 bookmarksopenlevel = 2,
1736 bookmarksopen = true,
1737 bookmarksdepth = 3,
1738 colorlinks = true, %Colours links instead of ugly boxes
1739 urlcolor = hu-berlin-blue, %Colour for external hyperlinks
1740 linkcolor = black, %Colour of internal links
1741 citecolor = black, %Colour of citations
1742 linktoc = page,
1743 pdfborder = {0 0 0},
1744 breaklinks = true, %allow line break inside links
1745 final
1746 }
1747 \RequirePackage{bookmark}
1748 \AtBeginDocument{%
1749 \RequirePackage[
1750 sort,
1751 nameinlink,
1752 compress,
1753 ngerman,english
1754 ]{cleveref}
1755 }
1756
1757 %---- newcommands
1758 \newcommand{\TeXografie}{Lukas C. Bossert
1759 (www.texografie.de)}
1760 \newcommand\huberlin{\huberlintitle\xspace}
1761
1762
1763 \newcommand\huberlinFolder{%
1764 \begingroup%
1765 \normalfont%
1766 \color{hu-berlin-blue}%
1767 % \faFolderOpen% taken from fontawesome
1768 \hspace{.3em}%
1769 \endgroup}
1770
1771
1772
1773 \RedeclareSectionCommands[
1774 tocraggedpagenumber,
1775 toclinefill=\tocpageseparator,
1776 tocindent=0em,
1777 tocnumwidth=4em,
1778 tocpagenumberbox=\tocpagenumberbox% <- added
1779 % tocpagenumberformat=\textsf,
1780 ]{chapter,section,subsection,subsubsection,paragraph}
1781
1782 \newcommand\tocgobble[1]{}% <- added
1783 \newcommand\tocpageseparator{\footnotesize\,\mbox{---}\,}
1784 \newcommand\tocpagenumberbox[1]{\mbox{#1}}% <- added
1785 \KOMAoptions{toc=indentunnumbered}
1786
1787 \RedeclareSectionCommand[
1788 % tocbeforeskip=1.25em plus 1pt
1789 ,tocentryformat=\large\scshape%
1790 ,tocindent=0em
1791 ,tocnumwidth=4em
1792 ,tocpagenumberbox=\tocgobble% <- added
1793 ]{part}
1794 %\addtokomafont{partentry}{\scshape\sffamily\bfseries}
1795
1796 \RedeclareSectionCommand[%
1797 % ,beforeskip=1.15em plus 1pt%
1798 ,tocentryformat=\textbf%
1799 % ,toclinefill={\TOCLineLeaderFill}%\TOCLineLeaderFill[\textbf{.}]
1800 ]{chapter}
1801
1802
1803 \newtcolorbox{example}[1][]{
1804 breakable,
1805 top=5pt,
1806 bottom=5pt,
1807 colback=hu-berlin-blue!10,
1808 colframe=hu-berlin-blue,
1809 left=5pt,
1810 right=5pt,
1811 sharp corners,
1812 boxrule=0pt,
1813 bottomrule=2pt,
1814 toprule=2pt,
1815 enhanced jigsaw,
1816 lefttitle=0pt,
1817 coltitle=white,
1818 fonttitle=\bfseries,
1819 fontupper=\small,%\ttfamily,
1820 % colbacktitle=hu-berlin-blue!20
1821 #1,
1822 }
1823
1824 % Replace the squat-u symbol for spaces
1825 % https://tex.stackexchange.com/a/488123/98739
1826 \makeatletter
1827 \def\lst@visiblespace{\lst@ttfamily{\char32}$\textcolor{hu-berlin-grey}{\cdot}$}
1828 \makeatother
1829
1830
1831 \lstset{%
1832 basicstyle = \linespread{0.7}\ttfamily
1833 ,breaklines = true
1834 ,breakatwhitespace
1835 ,alsoletter=\\\{\}\*\[\]\-
1836 ,showstringspaces=true
1837 }
1838
1839 \lstdefinestyle{hu-berlinlistingstyledef}{%
1840 tabsize = 4,
1841 breaklines = true,
1842 breakatwhitespace = true,
1843 postbreak=\mbox{$\hookrightarrow$},
1844 %keepspaces = true,
1845 escapeinside = {(*@}{@*)},
1846 moredelim = {[is][\ttfamily\bfseries\color{hu-berlin-blue}]{|}{|}},
1847 moredelim = {[is][\ttfamily\bfseries\color{hu-berlin-blue}]{|1}{1|}},
1848 moredelim = {[is][\ttfamily\bfseries\color{hu-berlin-red}]{|2}{2|}},
1849 aboveskip=0pt,
1850 belowskip=0pt,
1851 captionpos=b,
1852 resetmargins=true,
1853 sensitive=true,
1854 upquote=true,
1855 showspaces=true,
1856 showtabs=true,
1857 tab=\textcolor{hu-berlin-grey}{\rightarrowfill},
1858 %numbers=left,
1859 %numberstyle=\footnotesize\ttfamily\color{hu-berlin-grey},
1860 comment = [l]{\%},
1861 commentstyle = \footnotesize\color{hu-berlin-grey}\addfontfeature{LetterSpace=.7},
1862 % deletecomment = [l]{\%<}
1863 % morecomment = [l][\nullfont]{\%<},
1864 % deletecomment = [is]{\%<}{>},
1865 }
1866
1867 \lstdefinestyle{hu-berlinlistingstyle}{%
1868 language = {TeX},
1869 style = {hu-berlinlistingstyledef},
1870 }
1871
1872
1873
1874
1875
1876
1877 \tcbset{%
1878 hu-berlinstyle/.style={%
1879 enhanced,
1880 before skip=2mm,
1881 after skip=3mm,
1882 boxrule=0.7pt,
1883 left=2mm,
1884 right=2mm,
1885 top=2mm,
1886 bottom=2mm,
1887 sharp corners,
1888 colback=white,
1889 colbacklower=white,
1890 % fonttitle=\sffamily\bfseries,
1891 breakable,
1892 %before skip=\baselineskip,
1893 coltitle=white,
1894 colbacktitle=hu-berlin-blue!50!black,
1895 fonttitle=\bfseries\sffamily\footnotesize,
1896 % before upper={\mynote{\thetcbcounter}},
1897 title={\hfill{Example \thetcbcounter}},
1898 },
1899 codecomment/.style={%
1900 listing outside comment,%
1901 boxrule=0pt,
1902 colback=white,
1903 }
1904 }
1905
1906 \newtcolorbox{warning}[1][]{
1907 enhanced,
1908 before skip=2mm,
1909 after skip=3mm,
1910 boxrule=0.7pt,
1911 left=5mm,
1912 right=2mm,
1913 top=2mm,
1914 bottom=2mm,
1915 colback=white,
1916 colframe=yellow!20!black,
1917 sharp corners,
1918 rounded corners=southeast,
1919 arc is angular,
1920 arc=3mm,
1921 underlay={%
1922 \path[fill=hu-berlin-grey!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
1923 \path[draw=hu-berlin-grey,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
1924 \path[fill=red!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
1925 },
1926 drop fuzzy shadow,
1927 #1
1928 }
1929
1930 \AtBeginDocument{%
1931 \newtcblisting[%
1932 auto counter,
1933 crefname = {example}{examples},
1934 Crefname = {Example}{Examples},
1935 ]{codetext}[2][]{%
1936 hu-berlinstyle,
1937 % side text,
1938 rounded corners=northeast,
1939 arc=6mm,
1940 listing style=hu-berlinlistingstyle,
1941 label = #2,
1942 #1,
1943 }
1944
1945 \newtcblisting[%
1946 use counter from=codetext,
1947 crefname={code example}{code examples},
1948 Crefname={Code example}{Code examples}%
1949 ]{huberlincode}[2][]{%
1950 hu-berlinstyle,
1951 rounded corners=southeast,
1952 arc=6mm,
1953 listing only,
1954 listing style=hu-berlinlistingstyle,
1955 label = #2,
1956 #1,
1957 }
1958
1959
1960 \DeclareTCBInputListing[%
1961 use counter from=codetext,
1962 crefname={code example}{code examples},
1963 Crefname={Code example}{Code examples}%
1964 ]{\huberlinlisting}{ O{} m }{%
1965 hu-berlinstyle,
1966 listing file={#2},
1967 listing only,
1968 listing style=hu-berlinlistingstyle,
1969 #1,
1970 }
1971 }
1972 % \end{macrocode}
1973 % \begin{macrocode}
1974 \makeatletter
1975 \newrobustcmd*{\fnurl}[1][]{\hyper@normalise\ltd@fnurl{#1}}
1976 \def\ltd@fnurl#1#2{\footnote{#1\hyper@linkurl{\Hurl{#2}}{#2}}}
1977 \makeatother
1978 % \end{macrocode}
1979 % The first command is used to refrence packages with:
1980 % \cmd{\pkg}\marg{package name}.\footnote{Do not forget to
1981 % insert the name of the package into the makefile
1982 % in the definition of |PKG|.}
1983 % The name of the package is linked to its entry on CTAN and
1984 % refrenced to the bibliography in the end of this documentation.
1985 % \begin{macrocode}
1986 \RequirePackage{newfile}
1987 \newoutputstream{pkglist}
1988 % \end{macrocode}
1989 % \begin{macrocode}
1990 \NewDocumentCommand{\pkg}{om}{%
1991 \IfNoValueTF{#1}
1992 {\lowercase{\href{http://www.ctan.org/pkg/#2}}{\textbf{#2}}}
1993 {\lowercase{\href{http://www.ctan.org/pkg/#1-#2}}{\textbf{#2}}}%
1994 \space\cite{#2}%
1995 \addtostream{pkglist}{#2}}
1996 % \end{macrocode}
1997 % \begin{macrocode}
1998 \newrobustcmd*{\lit}[1]{\textsf{#1}}
1999 \newrobustcmd*{\Code}[1]{\texttt{#1}}
2000 \newrobustcmd*{\tex}{\TeX}
2001 \newrobustcmd*{\etex}{\mbox{e-TeX}}
2002 \newrobustcmd*{\pdftex}{pdf\-\tex}
2003 \newrobustcmd*{\xetex}{Xe\-\tex}
2004 \newrobustcmd*{\luatex}{Lua\-\tex}
2005 \newrobustcmd*{\latex}{\LaTeX}%{La\kern-0.07em TeX}
2006 \newrobustcmd*{\pdflatex}{pdf\-\latex}
2007 \newrobustcmd*{\xelatex}{Xe\-\latex}
2008 \newrobustcmd*{\lualatex}{Lua\-\latex}
2009 \newrobustcmd*{\miktex}{Mik\-\tex}
2010 \newrobustcmd*{\texlive}{\tex~live}
2011 \newrobustcmd*{\bibtex}{Bib\kern-0.07em TeX}
2012 \newrobustcmd*{\lppl}{\latex{} Project Public License}
2013 \newrobustcmd*{\pdf}{{PDF}}
2014 \newrobustcmd*{\md}{{MarkDown}}
2015 \newrobustcmd*{\utf}{\mbox{{UTF}-8}}
2016 % no \mbox here, we may have to break things
2017 \newrobustcmd*{\bibfield}[1]{\Code{#1}}
2018 \newrobustcmd*{\opt}[1]{\Code{#1}}
2019 \newrobustcmd*{\bibmacro}[1]{\Code{#1}}
2020 \newrobustcmd*{\bibtype}[1]{\Code{@#1}}
2021 %\renewrobustcmd*{\cmd}[1]{\Code{\textbackslash #1}}
2022 \renewrobustcmd\meta[1]{\normalfont{\textlangle}{\itshape#1\/}{\textrangle}}
2023
2024 % directly taken from ltxdoc.dtx
2025 \renewrobustcmd\marg[1]{%
2026 {\ttfamily\textcolor{hu-berlin-red}{\{}}%
2027 \meta{#1}%
2028 {\ttfamily\textcolor{hu-berlin-red}{\}}}%
2029 }
2030
2031 \renewrobustcmd\oarg[1]{%
2032 {\ttfamily\textcolor{hu-berlin-green}{[}}%
2033 \meta{#1}%
2034 {\ttfamily\textcolor{hu-berlin-green}{]}}%
2035 }
2036
2037 % adapted from listings.dtx (lstdoc.sty)
2038 \renewrobustcmd\cmd[1]{%
2039 \texttt{\color{hu-berlin-blue}\textbackslash\string#1}\xspace%
2040 }
2041
2042 \newrobustcmd\env[2][]{%
2043 \texttt{%
2044 \color{hu-berlin-blue}%
2045 \textbackslash begin\{\string#2\}#1}%
2046 \ldots
2047 \texttt{%
2048 \color{hu-berlin-blue}%
2049 \textbackslash end\{\string#2\}}%
2050 \xspace}
2051 % \end{macrocode}
2052 % For a common layout of the parameter style to identify code
2053 % of the different documents, files and packages we use
2054 % \cmd{param}\marg{name of the parameter}.
2055 % \begin{macrocode}
2056 \newcommand\param[1]{%
2057 \begingroup%
2058 \normalfont%
2059 \ttfamily%
2060 \bfseries%
2061 \textless%
2062 #1%
2063 \ttfamily%
2064 \bfseries%
2065 \textgreater%
2066 \endgroup}
2067 % \end{macrocode}
2068 % \begin{macrocode}
2069 \pdfstringdefDisableCommands{%
2070 \def\lstinline#1{<#1>}
2071 \def\tex{TeX}%
2072 \def\etex{e-TeX}%
2073 \def\xetex{XeTeX}%
2074 \def\latex{LaTeX}%
2075 \def\xelatex{XeLaTeX}%
2076 \def\bibtex{BibTeX}%
2077 \def\lppl{LaTeX Project Public License}%
2078 \def\pdf{PDF}%
2079 \def\utf{UTF-8}%
2080 \def\\{}%
2081 \def\texttt#1{<#1>}%
2082 \def\marg#1{\{#1\}}%
2083 \def\oarg#1{[#1]}%
2084 \def\color#1#2{}%
2085 \def\env#1{<#1>}
2086 \def\cmd#1{#1}
2087 }
2088 % https://tex.stackexchange.com/a/24067/98739
2089 \makeatletter
2090 \patchcmd{\scr@startchapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
2091 \makeatother
2092 %
2093 \RequirePackage[tightLists=false]{markdown}
2094 \markdownSetup{rendererPrototypes={%
2095 link = {\href{#3}{#1}}%
2096 }}
2097 %</style>
2098 % \end{macrocode}
2099 % \begin{macrocode}
2100 %</sty>
2101 % \end{macrocode}