Debian Codegraph @

texmf-dist/source/latex/rwth-ci/rwth-ci.dtx

raw
1 % \iffalse meta-comment
2 %
3 % RWTH-CI -- Corporate Design for RWTH Aachen University
4 % ----------------------------------------------------------------------------
5 %
6 % Copyright (C) 2025–2026 by Marei Peischl <[email protected]> and Lukas C. Bossert
7 %
8 % ============================================================================
9 % This work may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3c
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3c or later is part of all distributions of LaTeX
15 % version 2008/05/04 or later.
16 %
17 % This work has the LPPL maintenance status `maintained'.
18 %
19 % The Current Maintainer of this work is
20 % Marei Peischl <[email protected]>
21 %
22 % The development repository can be found at
23 % https://gitlab.git.nrw/rwth-it-center/rwth-latex-templates/rwth-ci
24 % Please use the issue tracker for feedback!
25 % ============================================================================
26 %
27 % \fi
28 %
29 % \iffalse
30 %<*driver>
31 \ProvidesFile{rwth-ci.dtx}
32 [2026-04-03 v1.2 Fundamental configuration for RWTH-CI]
33 %</driver>
34 %<@@=ptxcd>
35 %<*identification>
36 %<package|class>\NeedsTeXFormat{LaTeX2e}[2022/10/01]
37 %<package>\ProvidesExplPackage{rwth-layout}{2026-04-03}{1.2}{Fundamental configuration for for RWTH-CI}
38 %</identification>
39 %<*driver>
40 \documentclass[lm-default=false,cs-break-nohyphen]{l3doc}
41
42 \usepackage[highlightmode=immediate]{minted}
43 \usepackage{accsupp}
44 \setminted{
45 tabsize=2,
46 breaksymbol={\BeginAccSupp{method=escape,ActualText={}}\tiny\ensuremath{\hookrightarrow}\EndAccSupp{}}
47 }
48 \newenvironment{examplecode}{%
49 \VerbatimEnvironment%
50 \fvset{gobble=0}%
51 \begin{VerbatimOut}[gobble=1]{examplecode.out}%
52 }{%
53 \end{VerbatimOut}%
54 \inputminted[autogobble, escapeinside=||]{latex}{examplecode.out}%
55 }
56
57 \ExplSyntaxOn
58 \makeatletter
59 \tl_new:N \l__ptxtools_doc_values_tl
60 \newcommand*{\codefamily}{\MacroFont}
61 \DeclareTextFontCommand{\codefont}{\codefamily}
62 \providecommand{\option}[1]{\codefont{#1}}
63 \newcommand{\optionvalue}[1]{\codefont{#1}}
64
65 \cs_new:Npn \__ptxctools_parse_key_option:w #1 #2 #3 #4 = #5 \q_stop {
66 \begingroup
67 \let\PrintDescribeOption\PrintDescribeKeyOption
68 \tl_set:Nn \l__ptxtools_doc_values_tl {\small\IfBooleanTF{#3}{\textsf{#5}}{\textsf{(\codefont{#5})}}}
69 \noindent\DescribeOption{#4}\hfill
70 \small
71 \tl_if_blank:nTF {#2} {\meta{\textrm{initially~unset}}} {
72 \IfBooleanTF{#1}
73 {#2}
74 {(default:~\codefont{#2})}
75 }\strut\par
76 \endgroup
77 }
78
79 \newcommand*{\PrintDescribeKeyOption}[1]{
80 {\MacroFont #1=}\rlap{\hskip\marginparsep\l__ptxtools_doc_values_tl}
81 }
82
83 \bool_new:N \l_ptxtools_last_was_describe_bool
84 \NewDocumentCommand{\DescribeKeyOption}{smms}{
85 \bool_if:NTF \l_ptxtools_last_was_describe_bool {
86 \vskip -\lastskip
87 }{
88 \par
89 \dim_compare:nNnF {\parskip} > {\c_zero_dim} {\medskip}
90 }
91 \__ptxctools_parse_key_option:w #1 {#3} #4 #2 \q_stop
92
93 \bool_set_true:N \l_ptxtools_last_was_describe_bool
94 \AddToHookNext{para/begin}{
95 \bool_set_false:N \l_ptxtools_last_was_describe_bool
96 \OmitIndent
97 }
98 \smallskip
99 }
100
101 % to support small layout adjustments for the texdoc version
102 \newcommand*{\IfOnlyDocumentation}[1]{
103 \bool_if_exist:NT \g__codedoc_typeset_implementation_bool {
104 \bool_if:NF \g__codedoc_typeset_implementation_bool {#1}
105 }
106 }
107
108 \NewDocumentCommand{\PtxtoolsLoadDocDTX}{m}{
109 \exp_args:No \clist_map_inline:nn {#1} {\DocInput{##1}}
110 }
111
112 \ExplSyntaxOff
113
114 \usepackage{underscore-ltx}
115
116 \DeclareRobustCommand{\issue}[1]{%
117 {\DeclareFieldFormat{citeurlpostfix}{\href{##1/issues/#1}{\##1}}\citefield{othr-ci-repo}[citeurlpostfix]{url}}%
118 }
119 \newcommand*{\version}[1]{v#1}
120
121 \usepackage{tabularx}
122 \usepackage{biblatex}
123 \addbibresource{DEMO-RWTHBibliography.bib}
124
125 \usepackage{pifont}% Zapf-Dingbats Symbols
126 \newcommand*{\FeatureTrue}{\ding{52}}
127 \newcommand*{\FeatureFalse}{\ding{56}}
128
129 % Load RWTH-CI packages
130 \RequirePackage{rwth-colors}
131 \EnableCrossrefs
132
133 \CodelineIndex
134 \RecordChanges
135
136 \providecommand*{\PtxcdDocTitle}{\pkg{\jobname} -- \LaTeX{} using the Corporate Design of RWTH Aachen University}
137
138 \GetFileInfo{\jobname.dtx}
139 \DoNotIndex{\newcommand,\newenvironment}
140 \title{\PtxcdDocTitle^^A
141 \thanks{This file describes version \fileversion, last revised \filedate.}
142 }
143 \author{Marei Peischl\thanks{Email: \href{mailto:[email protected]}{[email protected]}}}
144 \date{\fileversion~of \filedate}
145
146 \renewcommand*{\partname}{Part}
147
148 % avoid conflict with | in bibliography
149 \RemoveFromHook{begindocument}[l3doc]
150 \AddToHook{begindocument/end}{
151 \MakeShortVerb \"
152 \MakeShortVerb \|
153 }
154
155 \begin{document}
156
157 \maketitle
158 \OnlyDescription
159 \DisableImplementation
160
161 \tableofcontents
162
163 \clearpage
164
165 \expandafter\ifx\csname PtxcdDocDTXfiles\endcsname\relax
166 \providecommand*{\PtxcdDocDTXfiles}{rwth-ci.dtx,rwth-fonts.dtx,rwth-colors.dtx,rwth-letter.dtx,rwth-beamer.dtx,rwth-sciposter.dtx}
167 \part{Global configuration and auxiliary packages}
168 \PtxtoolsLoadDocDTX{rwth-ci.dtx,rwth-fonts.dtx,rwth-colors.dtx}
169
170 \clearpage
171 \part{Document Types}
172 \PtxtoolsLoadDocDTX{rwth-letter.dtx,rwth-beamer.dtx,rwth-sciposter.dtx}
173 \else
174 \PtxtoolsLoadDocDTX{\PtxcdDocDTXfiles}
175 \fi
176
177 % Don't include Implementation on CTAN
178 \expandafter\ifx\csname DoNotTypesetImplementation\endcsname\relax
179 \DisableDocumentation\EnableImplementation
180 \begin{implementation}
181 \part{Implementation}
182 \end{implementation}
183 \PtxtoolsLoadDocDTX{\PtxcdDocDTXfiles}
184 \fi
185
186 \PrintChanges
187 \printbibliography
188 % Restore \code to be a wrapper for index numbers
189 \begingroup
190 \renewcommand*\code[1]{#1}
191 \PrintIndex
192 \endgroup
193
194 \end{document}
195 % \fi
196 % \begin{documentation}
197 %
198 % \end{documentation}
199 % \iffalse
200 %</driver>
201 % \fi
202 % \begin{macrocode}
203 %<class|package|(init&logo)>\tl_new:N \g_ptxcd_logofile_tl
204 % \end{macrocode}
205 % \iffalse
206 %<*init&department>
207 % \fi
208 % \begin{macrocode}
209 \tl_if_exist:NF \g_@@_config_prefix_tl {
210 \tl_new:N \g_@@_config_prefix_tl
211 \tl_gset:Nn \g_@@_config_prefix_tl {rwth-}
212 }
213 % \end{macrocode}
214 % \iffalse
215 %</init&department>
216 %<*class|package>
217 % \fi
218 % \begin{implementation}
219 % \begin{macrocode}
220 %<!beamer>\prop_new:N \g_ptxcd_clsopts_prop
221 %<!beamer>\int_new:N \g_ptxcd_paper_int
222 %<sciposter>\bool_new:N \g_@@_logo_bottom_bool
223 \str_const:Nn \c_@@_base_str {
224 %<beamer> beamer
225 %<sciposter> sciposter
226 %<package> layout
227 }
228 % \end{macrocode}
229 % \iffalse
230 %</class|package>
231 %<*class|(init&department)>
232 % \fi
233 % \changes{v1.2-dev}{2026-02-17}{Fix department config for letters and prepare to support additional packages.}
234 % \begin{macrocode}
235 \msg_if_exist:nnF {rwth-ci} {no-departmentconfig-found} {
236 \msg_new:nnn {rwth-ci} {no-departmentconfig-found} {
237 The~package~has~been~configured~to~load~the~config~file~“#1”.\\
238 I~can't~find~this~file.~Skipping.
239 }
240 }
241 \hook_gput_code:nnn {
242 %<class> class/\@currname/after
243 %<!class> package/\@currname/after
244 }{
245 \@currname/department-config
246 }{
247 \file_if_exist_input:nF {\g_@@_config_prefix_tl\g_ptxcd_department_str.cfg} {
248 \str_if_eq:eeF {\g_@@_config_prefix_tl\g_ptxcd_department_str} {rwth-default} {
249 \msg_note:nne {rwth-ci} {no-departmentconfig-found} {\g_@@_config_prefix_tl\g_ptxcd_department_str.cfg}
250 }
251 }
252 }
253 % \end{macrocode}
254 % \iffalse
255 %</class|(init&department)>
256 %<*class|package>
257 % \fi
258 % \begin{macrocode}
259 \exp_args:Ne \keys_define:nn {ptxcd/\c_@@_base_str} {
260 % \end{macrocode}
261 % \iffalse
262 %</class|package>
263 %<*options>
264 % \fi
265 % \end{implementation}
266 % \begin{documentation}
267 % \section{General configuration options}
268 % \DescribeKeyOption{logofile=\meta{file name/path}}{rwth_mx}
269 % Is used to configure specific logos.
270 % The logos are reserved to be used by RWTH departments and may therefore not be published within this bundle.
271 %
272 % Depending on the color mode (see \autoref{sec:colormode}) the actual file searched for will be extended by the suffices |_cmyk| or |_rgb|.
273 % Within this document the file |rwth_mx_cmyk| was used.
274 % \end{documentation}
275 % \begin{implementation}
276 % \begin{optionenv}{logofile}
277 % \changes{v1.0}{2025-12-18}{init .pdf extension if no extension was found}
278 % \begin{macrocode}
279 logofile .code:n = {
280 \file_parse_full_name:nNNN {#1} \g_tmpa_tl \l_tmpa_tl \l_tmpb_tl
281 \tl_gset:Ne \g_ptxcd_logofile_tl {\tl_if_empty:NF \g_tmpa_tl {\g_tmpa_tl/}\l_tmpa_tl}
282 \tl_if_empty:NTF \l_tmpb_tl {
283 \tl_if_empty:NT \g_@@_logofile_ext_tl {
284 \tl_gset:Nn \g_@@_logofile_ext_tl {.pdf}
285 }
286 }{
287 \tl_gset_eq:NN \g_@@_logofile_ext_tl \l_tmpb_tl
288 }
289 },
290 %<class> logofile .initial:n = ,
291 % \end{macrocode}
292 % \end{optionenv}
293 % \end{implementation}
294 % \begin{documentation}
295 % \DescribeKeyOption{logofile-ext=\meta{extension}}{.pdf}
296 % \end{documentation}
297 % \begin{implementation}
298 % \begin{optionenv}{logofile-ext}
299 % \begin{macrocode}
300 logofile-ext .tl_gset:N = \g_@@_logofile_ext_tl,
301 %<class> logofile-ext .initial:n = .pdf,
302 % \end{macrocode}
303 % \end{optionenv}
304 % \end{implementation}
305 % \begin{documentation}
306 % \DescribeKeyOption{accept-missing-logos=\meta{boolean}}{false but switched to true, if no logofile is selected}
307 % As the logo files sadly may not be published within this bundle, the default setting allows all files to be compiled without a logo.
308 % There will be a warning and the logo postion will be marked showing the desired filename.
309 % \end{documentation}
310 % \begin{implementation}
311 % \begin{optionenv}{accept-missing-logos}
312 % \begin{macrocode}
313 accept-missing-logos .bool_gset:N = \g_@@_logo_workaround_bool,
314 %<class> accept-missing-logos .initial:n = false,
315 accept-missing-logos .usage:n = load,
316 accept-missing-logos .default:n = true,
317 % \end{macrocode}
318 % \end{optionenv}
319 % \end{implementation}
320 % \iffalse
321 %</options>
322 %<*options|fonts>
323 % \fi
324 % \begin{implementation}
325 % undocumented feature
326 % \begin{optionenv}{LaTeX-logo}
327 % \begin{macrocode}
328 LaTeX-logo .bool_gset:N = \g_@@_use_LaTeX_Logo_bool,
329 %<fonts> LaTeX-logo .initial:n = false,
330 %<fonts> LaTeX-logo .usage:n = load,
331 % \end{macrocode}
332 % \end{optionenv}
333 % \end{implementation}
334 % \iffalse
335 %</options|fonts>
336 %<*options>
337 % \fi
338 % \begin{documentation}
339 % \DescribeKeyOption{department=\meta{department}}{default}
340 % RWTH-CI supports department specific configuration files.
341 % The \optionvalue{default} is used to detect if a user specific setting was provided.
342 % \DescribeKeyOption{departmentconfigprefix=\meta{prefix}}{rwth-}
343 % By default this setting will search for files called |rwth-|\meta{department}|.cfg|, where |rwth-| can be changed using \option{departmentconfigprefix}.
344 % This option could also be used to load config files from specific subdirectories.
345 % This might be useful if a specific department wants some internal templates to be shared separately.
346 % \end{documentation}
347 % \begin{implementation}
348 % \begin{optionenv}{department}
349 % \begin{macrocode}
350 department .choice:,
351 department / default .code:n = \str_gset:Nn \g_ptxcd_department_str {default},
352 %<class> department .initial:n = default,
353 department / unknown .code:n = {
354 \str_gset:NV \g_ptxcd_department_str \l_keys_value_tl
355 },
356 % \end{macrocode}
357 % \end{optionenv}
358 % \begin{optionenv}{departmentconfigprefix}
359 % \begin{macrocode}
360 departmentconfigprefix .tl_gset:N = \g_@@_config_prefix_tl,
361 %<class> departmentconfigprefix .initial:n = rwth-,
362 % \end{macrocode}
363 % \end{optionenv}
364 % \end{implementation}
365 % \begin{documentation}
366 % \DescribeKeyOption{colormode=RGB/cmyk}{depens on document type}
367 % Selects the color scheme to be converted to.
368 % This will also affect the logo selection.
369 % \end{documentation}
370 % \begin{implementation}
371 % \begin{optionenv}{colormode}
372 % \begin{macrocode}
373 colormode .code:n = \PassOptionsToPackage{colormode=#1}{rwth-colors},
374 RGB .code:n = \PassOptionsToPackage{colormode=RGB}{rwth-colors},
375 cmyk .code:n = \PassOptionsToPackage{colormode=RGB}{rwth-colors},
376 % \end{macrocode}
377 % \end{optionenv}
378 % \begin{macrocode}
379 %<!titlegraphic-opt&(init-department|class)> titlegraphic .code:n = \PassOptionsToPackage{titlegraphic={#1}}{beamerinnerthemeRWTH},
380 % \end{macrocode}
381 % \end{implementation}
382 % \iffalse
383 %<*sciposter>
384 % \fi
385 % \begin{documentation}
386 % \DescribeKeyOption{logo=top/bottom}{top}
387 % Allows to change the logo position. This option is currently only supported by the \cls{rwth-sciposter}.
388 % \end{documentation}
389 % \begin{implementation}
390 % \begin{optionenv}{logo}
391 % \begin{macrocode}
392 logo .choice:,
393 logo / bottom .code:n = { \bool_gset_true:N \g_@@_logo_bottom_bool },
394 logo / top .code:n = { \bool_gset_false:N \g_@@_logo_bottom_bool },
395 logo / head .meta:n = {logo=top},
396 logo / foot .meta:n = {logo=bottom},
397 logo .initial:n = {top},
398 % \end{macrocode}
399 % \end{optionenv}
400 % \end{implementation}
401 % \iffalse
402 %</sciposter>
403 %<*letter|sciposter|package>
404 % \fi
405 % \begin{documentation}
406 % \DescribeKeyOption{raggedright=\meta{boolean}}{true}
407 % The CI requires all text to be set ragged right.
408 % This option can be used to disable this setting to avoid conflicts with additional packages or configuration to adjust the placement of elements.
409 % In general this setting will be enabled at |\begin{document}| but for \pkg{rwth-letter} the option \option{letterhooks} allows to limit this setting for the letter environment.
410 % \end{documentation}
411 % \begin{implementation}
412 % \begin{optionenv}{raggedright}
413 % \begin{macrocode}
414 raggedright .bool_gset:N = \g_@@_raggedright_bool,
415 raggedright .initial:n = true,
416 raggedright .default:n = true,
417 raggedright .usage:n = load,
418 % \end{macrocode}
419 % \end{optionenv}
420 % \iffalse
421 %</letter|sciposter|package>
422 %</options>
423 %<*titlegraphic-opt>
424 % \fi
425 % \end{implementation}
426 % \begin{documentation}
427 % \DescribeKeyOption{titlegraphic=1:3,2:3,false}{1:3}
428 % The titlegraphic can be used in different sizes.
429 % This option is currently only supported by \cls{rwth-beamer}.
430 %
431 % This option can be changed locally.
432 % Therefore the |\titlepage| command was extended to accept an optional argument.
433 % \begin{examplecode}
434 % \titlepage[titlegraphic=1:3]
435 % \end{examplecode}
436 % \end{documentation}
437 % \begin{implementation}
438 % \begin{optionenv}{titlegraphic}
439 % \begin{macrocode}
440 titlegraphic-ratio .str_set:N = \l__ptxcd_titlegraphic_ratio_str,
441 titlegraphic .multichoice:,
442 titlegraphic / 1:3 .meta:n ={titlegraphic-ratio={1:3}},
443 titlegraphic / 2:3 .meta:n = {titlegraphic-ratio={2:3}},
444 titlegraphic / false .meta:n = {titlepage=plain},
445 titlegraphic / true .meta:n = {titlepage=graphics},
446 titlegraphic .initial:n = 1:3,
447 % \end{macrocode}
448 % \end{optionenv}
449 % \end{implementation}
450 % \iffalse
451 %</titlegraphic-opt>
452 %<*options>
453 %<*titlesepline>
454 % \fi
455 % \begin{documentation}
456 % \DescribeKeyOption{titlesepline=\meta{boolean}}{false}
457 % This option is currently only supported by \cls{rwth-beamer}.
458 % \end{documentation}
459 % \begin{implementation}
460 % \begin{optionenv}{titlesepline}
461 % \begin{macrocode},
462 titlesepline .bool_gset:N = \g_@@_titlesepline_bool,
463 titlesepline .initial:n = true,
464 titlesepline .default:n = true,
465 % \end{macrocode}
466 % \end{optionenv}
467 % \end{implementation}
468 % \iffalse
469 %</titlesepline>
470 %<*print>
471 % \fi
472 % \begin{implementation}
473 % fontsize
474 % \begin{optionenv}{fontsize}
475 % \begin{macrocode}
476 fontsize .code:n = \prop_gput:Nnn \g_ptxcd_clsopts_prop {fontsize} {#1},
477 fontsize .initial:n =
478 %<beamer> 9 pt,% beamer
479 %<sciposter> 23bp,
480 % \end{macrocode}
481 % \end{optionenv}
482 % \end{implementation}
483 % \begin{documentation}
484 % \iffalse\DescribeKeyOption{paper=a\meta{n}/portrait/landscape}{\meta{depends on document type}}\fi
485 % \DescribeKeyOption{paper=portrait/landscape}{\meta{depends on document type}}
486 % The supported paper sizes as well as the default setting depends on the document type.
487 % \iffalse Standard print documents use \optionvalue{a4} and support the fulle range from \optionvalue{a0} to \optionvalue{a6}. \fi
488 % The default values for posters is \optionvalue{a0} and \optionvalue{portrait}.
489 % \end{documentation}
490 % \begin{implementation}
491 % \changes{v1.1}{2026-04-03}{Add support for landscape and portrait als boolean options.}
492 % \begin{optionenv}{paper}
493 % \begin{macrocode}
494 paper .multichoices:nn = {
495 %<sciposter> a0%%,a1,a2,a3
496 %<poster> a0,a1,a2,a3,a4
497 %<!(sciposter|poster)> a0,a1,a2,a3,a4,a5,a6
498 }{
499 \int_gset_eq:NN \g_ptxcd_paper_int \l_keys_choice_int
500 %<!(sciposter|poster)> \exp_args:Nx \PassOptionsToPackage{paper=\l_keys_choice_tl}{typearea}
501 \exp_args:Nx \PassOptionsToPackage{\l_keys_choice_tl paper}{geometry}
502 },
503 paper .initial:n =
504 %<!(sciposter|poster)> a4,
505 %<sciposter|poster> a0,
506 % \end{macrocode}
507 % \iffalse
508 %<*sciposter>
509 % \fi
510 % \begin{macrocode}
511 paper / landscape .code:n = \PassOptionsToPackage{landscape}{geometry},
512 paper / portrait .code:n = \PassOptionsToPackage{portrait}{geometry},
513 landscape / .choice:,
514 landscape / true .meta:n = {paper = landscape},
515 landscape / false .meta:n = {paper = portrait},
516 portrait / .choice:,
517 portrait / true .meta:n = {paper = portrait},
518 portrait / false .meta:n = {paper = landscape},
519 % \end{macrocode}
520 % \end{optionenv}
521 % \iffalse
522 %</sciposter>
523 %</print>
524 %<*class&!beamer>
525 % \fi
526 % \begin{macrocode}
527 unknown .code:n = {\prop_gput:NVn \g_ptxcd_clsopts_prop \l_keys_key_tl {#1}},
528 % \end{macrocode}
529 % \iffalse
530 %</class&!beamer>
531 %</options>
532 % \fi
533 % \begin{macrocode}
534 %<processoptions|package>}
535 % \end{macrocode}
536 % \iffalse
537 %<*processoptions|init-department>
538 % \fi
539 % \begin{macrocode}
540 \str_if_exist:NF \g_ptxcd_department_str {
541 \str_new:N \g_ptxcd_department_str
542 \str_gset:Nn \g_ptxcd_department_str {default}
543 }
544 % \end{macrocode}
545 % \iffalse
546 %</processoptions|init-department>
547 %<*!theme>
548 %<*processoptions|(beamer&buildOptions)>
549 % \fi
550 % Allow to add options via l3build |typesetcmds|.
551 % Be aware that in this case also the group has to be expanded.
552 % \begin{macrocode}
553 \cs_if_exist:NT \ptxcdDefaultBuildOptions {
554 \exp_args:Ne \keys_set:ne { ptxcd /
555 %<class|beamer> \c_@@_base_str
556 %<letter> letter
557 } {
558 \ptxcdDefaultBuildOptions
559 }
560 }
561 % \end{macrocode}
562 % \iffalse
563 %</processoptions|(beamer&buildOptions)>
564 %</!theme>
565 %<*processoptions|package>
566 % \fi
567 % \begin{macrocode}
568 %<class|package>\ProcessKeyOptions[ptxcd/\c_@@_base_str]
569 % \end{macrocode}
570 % \iffalse
571 %</processoptions|package>
572 %<ExplSyntax>\ExplSyntaxOn
573 %<*logoFallback>
574 % \fi
575 % \changes{v0.2}{2025-11-12}{enable accept-missing-logos for the default logo setup}
576 % \begin{macrocode}
577 \tl_if_empty:NT \g_ptxcd_logofile_tl {
578 \msg_new:nnn {rwth-ci} {no-logo-selected} {You~did~not~select~a~logofile.\\
579 I~will~try~to~use~the~example~logo~`rwth_mx`~and~enable~the~`accept-missing-logos`}
580 \msg_warning:nn {rwth-ci} {no-logo-selected}
581 \tl_gset:Nn \g_ptxcd_logofile_tl {rwth_mx}
582 \tl_gset:Nn \g_@@_logofile_ext_tl {.pdf}
583 \bool_gset_true:N \g_@@_logo_workaround_bool
584 }
585 % \end{macrocode}
586 % Define a macro to insert the logo workaround to only need this definition once.
587 % \changes{v0.2}{2025-11-12}{Add warning if logo fallback is active.}
588 % \begin{macrocode}
589 \msg_new:nnn {rwth-ci} {missing-logofile} {%
590 The~logofile~(#1)~could~not~be~found.\\
591 Please~check~if~if~can~be~found~by~the~compiler.
592 }
593 \cs_new:Nn \_@@_insert_logo:n {
594 % \end{macrocode}
595 % TODO: Check if rgb is a good default for logo selection.
596 % Try to detect if colormode specific file is available.
597 % \begin{macrocode}
598 \file_if_exist:nTF {\g_ptxcd_logofile_tl\tl_if_empty:NTF \g_@@_colormode_tl {_rgb} {_\g_@@_colormode_tl}\g_@@_logofile_ext_tl } {
599 \bool_set_true:N \l_tmpa_bool
600 \bool_set_true:N \l_tmpb_bool
601 }{
602 \bool_set_false:N \l_tmpa_bool
603 \file_if_exist:nTF {\g_ptxcd_logofile_tl\g_@@_logofile_ext_tl}
604 {\bool_set_true:N \l_tmpb_bool}
605 {\bool_set_false:N \l_tmpb_bool}
606 }
607 \bool_if:NTF \g_@@_logo_workaround_bool {
608 \bool_if:NTF \l_tmpb_bool
609 \use_i:nn
610 \use_ii:nn
611 }{
612 \use_i:nn
613 }
614 {\includegraphics[height=#1]{\g_ptxcd_logofile_tl\bool_if:NT \l_tmpa_bool {\tl_if_empty:NTF \g_@@_colormode_tl {_rgb} {_\g_@@_colormode_tl}}\g_@@_logofile_ext_tl}}
615 {
616 %<!beamer> \frame
617 %<beamer> \framelatex
618 {\parbox[c][#1][c]{2.186\dimexpr#1}{\centering<Missing~Logo~file~\tl_to_str:N \g_ptxcd_logofile_tl>}}
619 \msg_warning:nnV {rwth-ci} {missing-logofile} \g_ptxcd_logofile_tl
620 }
621 }
622 % \end{macrocode}
623 % \iffalse
624 %</logoFallback>
625 %<*titlegraphic-setup>
626 % \fi
627 % \end{implementation}
628 % \begin{documentation}
629 % \section{RWTH-CI specific title elements}
630 % All templates except the \pkg{rwth-letter}, are configured to use |\title|, |author|, \dots for configuration of the title block/page.
631 % There are some additional elements which can be used depending on the document type.
632 %
633 % \DescribeMacro{\titlegraphic}
634 % Accepts any \LaTeX{} content, does not have to be an image.
635 % This is placed flush with the top corner in the main part of the title page.
636 % This macro is usually used to place a graphic:
637 % \begin{examplecode}
638 % \titlegraphic{\includegraphics[width=\width]{example-image-plain}}
639 % \end{examplecode}
640 % \DescribeMacro{\width}\DescribeMacro{\height}
641 % \cs[no-index]{width} and \cs[no-index]{height} can be used to select the appropriate size of the image.
642 % There also is a starred variant \cs[no-index]{titlegraphic*}, to allow automatic scaling and any necessary clipping to fill the reserved space. This is done automatically using \pkg{trimclip}.
643 % \begin{examplecode}
644 % \titlegraphic*{\includegraphics{example-image-plain}}
645 % \end{examplecode}
646 % \end{documentation}
647 % \begin{implementation}
648 % \begin{macrocode}
649 \RequirePackage{trimclip}
650 \box_new:N \l_@@_titlegraphic_box
651 %<!beamer>\NewDocumentCommand
652 %<beamer>\RenewDocumentCommand
653 {\titlegraphic}{sm}{
654 \IfBooleanTF{#1}{
655 %<!beamer> \tl_gset:Nn \g_ptxcd_titleimage_code_tl
656 %<beamer> \def\inserttitlegraphic
657 {
658 \hbox_set:Nn \l_@@_titlegraphic_box {\raisebox{\depth}{#2}}
659 \box_resize_to_wd:Nn \l_@@_titlegraphic_box {\width}
660 \dim_compare:nTF {\box_ht:N \l_@@_titlegraphic_box -\height> \c_zero_dim}
661 {
662 \dim_set:Nn \l_tmpa_dim {.5\box_ht:N \l_@@_titlegraphic_box - .5\height}
663 \clipbox{0pt~\dim_eval:n{\l_tmpa_dim}~0pt~\dim_eval:n{\l_tmpa_dim}}{\box_use:N \l_@@_titlegraphic_box}
664 }{
665 \box_resize_to_ht:Nn \l_@@_titlegraphic_box {\height}
666 \dim_set:Nn \l_tmpa_dim {(\box_wd:N \l_@@_titlegraphic_box - \width) / 2}
667 \clipbox{\dim_eval:n{\l_tmpa_dim}~0pt~\dim_eval:n{\l_tmpa_dim}~0pt}{\box_use:N \l_@@_titlegraphic_box}
668 }
669 }
670 }{
671 %<!beamer> \tl_gset:Nn \g_ptxcd_titleimage_code_tl
672 %<beamer> \def\inserttitlegraphic
673 {#2}
674 }
675 }
676 % \end{macrocode}
677 % \iffalse
678 %</titlegraphic-setup>
679 % \fi
680 % \begin{macrocode}
681 %<ExplSyntax>\ExplSyntaxOff
682 % \end{macrocode}
683 % \iffalse
684 %<*package>
685 % \fi
686 % \begin{macrocode}
687 \PassOptionsToPackage{fontdefaults=true}{rwth-fonts}
688 \RequirePackage{rwth-fonts}
689 \RequirePackage{rwth-colors}
690 \bool_if:NT \g_@@_raggedright_bool {
691 \hook_gput_code:nnn {begindocument/end} {rwth-ci/raggedright} {\raggedright}
692 }
693 \RequirePackage{scrlayer-scrpage}
694 \RequirePackage{graphicx}
695 \DeclareNewLayer[background,align=tl,voffset=0mm, hoffset=20mm,
696 mode=picture,
697 width=\dim_eval:n {\paperwidth-25mm},
698 height=32mm,
699 contents={\makebox[\layerwidth][r]{\_@@_insert_logo:n {\layerheight}}}
700 ]{rwth-logo}
701 \AddLayersToPageStyle{scrheadings}{rwth-logo}
702 % \end{macrocode}
703 % \iffalse
704 %</package>
705 % \fi
706 % \end{implementation}
707 \endinput