-
Notifications
You must be signed in to change notification settings - Fork 0
/
tum-physics.sty
1847 lines (1819 loc) · 71.8 KB
/
tum-physics.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% --------------------------------------------------------------------------------
%% ____ TUM physics package from Michael Labenbacher 2020 _____
%% --------------------------------------------------------------------------------
%% LOAD: LaTeX3-packages: expl3, l3keys2e and xparse,... as "Standard"
%% expl3 = LaTeX3
\RequirePackage{expl3}%
%% xkeyval = Extension of the keyval package
\RequirePackage{xkeyval}%
%% ltxcmds = Some LATEX kernel commands for general use
\RequirePackage{ltxcmds}%
%% kvoptions = Key value format for package options
\RequirePackage{kvoptions}%
%% kvsetkeys = Key value parser with default handler support
\RequirePackage{kvsetkeys}%
%% kvdefinekeys = efine keys for use in the kvsetkeys package
\RequirePackage{kvdefinekeys}%
%% l3keys2e = LaTeX2ε option processing using LaTeX3 keys
%% needed from siunitx
\RequirePackage{l3keys2e}%
%% etex = An extended version of TeX (NTS-project)
\RequirePackage{etex}%
%% etexcmds = Avoid name clashes with e-TeX commands
\RequirePackage{etexcmds}%
%% ifxetex = Am I running under XeTeX?
%% needed by authors (pdflscape)
\RequirePackage{ifxetex}%
%% ifluatex = Provides the \ifluatex switch
\RequirePackage{ifluatex}%
%% etoolbox = eTeX-tools for LaTeX
%% (\AtEndPreamble (before main aux file read) - \begin{document} - \AtBeginDocument - \AfterEndPreamble)
\RequirePackage{etoolbox}%
%% xparse = A generic document command parser (LaTeX3)
\RequirePackage{xparse}%
%% ifthen = Conditional commands in LaTeX documents
%% needed by authors (pdflscape)
\RequirePackage{ifthen}%
%% calc = Simple arithmetic in LaTeX commands
%% needed by authors (pdflscape)
\RequirePackage{calc}%
%% silence = Selective filtering of error messages and warnings
%% for todonotes, tumctoc (scrwfile)
\RequirePackage{silence}%
\WarningsOff[scrwfile]%
%% ================================================================================
%% ================================================================================
%% ======================== Package-Options (ExplSyntaxOn) =======================
%% ================================================================================
%% ================================================================================
%% Declaration of the required TeX-format
%% LaTeX2e ... "newest, stable" LaTeX-release (currently)
\NeedsTeXFormat{LaTeX2e}%
%% Version number
\makeatletter%
\def\@TUM@version@hook{001}%
% {scrbook}{\def\@TUM@version@hook{000}}{}%
% {scrreprt}{\def\@TUM@version@hook{001}}{}%
% {scrartcl}{\def\@TUM@version@hook{002}}{}%
% {revtex4-2}{\def\@TUM@version@hook{003}}{}%
% {transcript}{\def\@TUM@version@hook{004}}{}%
% {cheatsheet}{\def\@TUM@version@hook{005}}{}%
\def\TUMversion{1.0.3.nightly.\@TUM@version@hook000000010003}%
\def\TUMversiondate{2020-09-23}%
\makeatother%
%% Information of the provided package
%% ProvidesExplPackage{name of package}{YYYY-MM-DD}{version}{more information}
%% ExplSyntax is ON after this...
\ProvidesExplPackage {tum-physics} {\TUMversiondate} {\TUMversion}%
{A "package" made by Michael Labenbacher, scrbook/scrreprt, :P}%
%% Output on the command-line in the log-file
\typeout{==========================================================================}
\typeout{Version:~\TUMversion}%
\typeout{000~for:~--~paper=a4,11/12pt,twoside,open=right~--~scrbook}%
\typeout{001~for:~--~paper=a4,11/12pt,oneside,open=any~--~scrreprt}%
\typeout{002~for:~--~paper=a4,11/12pt,twoside,open=right~--~scrartcl}%
\typeout{003~for:~--~a4paper,11/12pt,oneside~--~revtex4-2}%
\typeout{004~for:~--~paper=a4,11/12pt,oneside~--~scrreprt,~(transcript)}%
\typeout{005~for:~--~paper=a3,11/12pt/tiny,oneside~--~scrreprt,~(cheatsheet)}%
\typeout{Author:~Labenbacher~Michael}%
\typeout{==========================================================================}
%% ----------------------------------- Options ------------------------------------
%% Options: debug (bool), todo (bool), printlist (bool)
\bool_new:N \l_debug_key_bool%
\bool_new:N \l_todo_key_bool%
\bool_new:N \l_notecolumn_key_bool%
\bool_new:N \l_printlist_key_bool%
\keys_define:nn {tum-physics}{%
debug .bool_set:N = \l_debug_key_bool,%
debug .default:n = false,%
todo .bool_set:N = \l_todo_key_bool,%
todo .default:n = false,%
notecolumn .bool_set:N = \l_notecolumn_key_bool,%
notecolumn .default:n = false,%
printlist .bool_set:N = \l_printlist_key_bool,%
printlist .default:n = false,%
}%
\ProcessKeysPackageOptions{tum-physics}%
%% -------- DocumentCommand: TUMRequirePackage and TUMPassOptionsToPackage --------
%% Messages for \TUMRequirePackage
\msg_new:nnn {tum-physics} {require_package/loaded_before_by_you} {}%
\msg_new:nnn {tum-physics} {require_package/loaded_before_by_other} {}%
\msg_new:nnn {tum-physics} {require_package/no_package} {}%
\msg_new:nnn {tum-physics} {require_package/some_loaded_before} {}%
\msg_new:nnn {tum-physics} {require_package/requirements_not_fulfilled} {}%
\msg_new:nnn {tum-physics} {check_package/do_not_load} {}%
\msg_new:nnn {tum-physics} {check_package/requirements_not_fulfilled} {}%
\msg_new:nnn {tum-physics} {pass_optoins_to_package/requirements_not_fulfilled} {}%
\msg_new:nnn {tum-physics} {pass_optoins_to_package/options_passed_to_late} {}%
%% Package <...> must be loaded after/before the packages <...>
%% (!!) very important: See documentation
%% (!) important: ---
\bool_new:N \l_if_package_after_bool%
\prop_new:N \l_package_after_prop%
%% package must be loaded after = {package(s)}
\prop_set_from_keyval:Nn \l_package_after_prop {%
showframe={ltxcmds,iftex,xcolor},% (!!)
lipsum={geometry,multicol,babel},% (!!)
ifpdf={microtype},% (!)
inputenc={babel},%
fontenc={scrlayer-scrpage},%
microtype={babel,upgreek},% (!)
babel={amsmath},% (!)
biblatex={scrlayer-scrpage,url},% (!!)
csquotes={biblatex},% (!!)
multirow={longtable},%
nicefrac={graphicx},%
xfrac={graphicx},% (!)
graphbox={graphicx},%
graphics={microtype},% (!)
color={microtype},% (!)
pdfpages={pdflscape,graphicx,ifthen,calc},% (!)
pstricks={microtype},% (!)
environ={trimspaces},%
tcolorbox={tikz,pgf,verbatim,etoolbox,environ,listings},% (!!)
chemformula={xparse, l3keys2e, xfrac, tikz, amstext, nicefrac, scrlfile},%
chemmacros={upgreek, expl3, xparse, l3keys2e, etoolbox, iftex, ltxcmds, chemgreek, tikz, pgf, graphicx, graphics, xcolor, pgfkeys, pgfmath, amsmath, amsbsy, amstext, amsgen, textcomp, xtemplate, xfrac, nicefrac, ifthen},% (!)
siunitx={array},%
nicematrix={tikz, expl3, l3keys2e, array, amsmath, xparse},% (!)
scrhack={datetime,listings,tcolorbox,tikz},% (!!)
float={scrhack},% (!!)
hyperref={scrhack,float,longtable,url,microtype,kvdefinekeys},% (!!)
nccmath={hyperref},% (!!)
bookmark={hyperref},% (!!)
kvoptions={ltxcmds},%
xkeyval={keyval},%
glossaries={hyperref},% (!!)
scrlayer-notecolumn={scrlayer-scrpage},% (!)
glossaries-extra={hyperref, babel, multicol, bookmark, longtable, supertabular, amsmath, amstext, amsgen, amsbsy, amsopn, etoolbox, ifthen, xkeyval},% (!!)
todonotes={ifthen, xkeyval, xcolor, tikz, pgf, pgfrcs, pgfsys, pgffor, graphicx, graphics, trig, pgfkeys, pgfmath, calc}% (!!)
}%
\bool_new:N \l_if_package_before_bool%
\prop_new:N \l_package_before_prop%
%% package must be loaded before = {package(s)}
\prop_set_from_keyval:Nn \l_package_before_prop {%
inputenc={glossaries-extra},%
fontenc={glossaries-extra},%
multicol={glossaries-extra},%
polyglossia={todonotes, glossaries-extra},%
keyval={xkeyval},%
xkeyval={todonotes,glossaries-extra},%
ltxcmds={kvoptions},%
everysel={ragged2e},%
microtype={ifpdf,graphics,color,pstricks,hyperref},%
babel={inputenc,microtype,lipsum,glossaries-extra},%
scrlayer-scrpage={fontenc,biblatex},%
upgreek={microtype,chemmacros},%
amsmath={babel,glossaries-extra},%
url={biblatex,hyperref},%
biblatex={csquotes},%
longtable={multirow,hyperref,glossaries-extra},%
supertabular={glossaries-extra},%
graphicx={nicefrac,xfrac,graphbox,pdfpages,chemmacros,todonotes},%
pdflscape={pdfpages},%
ifthen={pdfpages,chemmacros,todonotes,glossaries-extra},%
calc={pdfpages,todonotes},%
trimspaces={environ},%
tikz={tcolorbox,chemformula,chemmacros,nicematrix,scrhack,todonotes},%
pgf={tcolorbox,chemmacros,todonotes},%
pgfrcs={todonotes},%
pgffor={todonotes},%
trig={todonotes},%
verbatim={tcolorbox},%
etoolbox={tcolorbox,chemmacros,glossaries-extra},%
environ={tcolorbox},%
listings={tcolorbox,scrhack},%
xparse={chemformula,chemmacros,nicematrix},%
l3keys2e={chemformula,chemmacros,nicematrix},%
xfrac={chemformula,chemmacros},%
amstext={chemformula,chemmacros},%
nicefrac={chemformula,chemmacros},%
scrlfile={chemformula},%
expl3={chemmacros,nicematrix},%
iftex={chemmacros},%
multicol={lipsum},%
ltxcmds={chemmacros},%
chemgreek={chemmacros},%
graphics={chemmacros,lscape,todonotes},%
xcolor={chemmacros,todonotes,showframe},%
pgfkeys={chemmacros,todonotes},%
pgfmath={chemmacros,todonotes},%
amsmath={chemmacros,nicematrix},%
amsbsy={chemmacros},%
amsgen={chemmacros},%
textcomp={chemmacros},%
xtemplate={chemmacros},%
todonotes={menukeys},%
array={siunitx,nicematrix},%
datetime={scrhack},%
tcolorbox={scrhack},%
scrhack={float,hyperref},%
float={hyperref},%
bookmark={glossaries-extra},%
hyperref={nccmath,bookmark,glossaries,glossaries-extra},%
geometry={lipsum}%
}%
%% Packages which must not be loaded due to {...}
%\clist_new:N \l_do_not_load_clist
\prop_new:N \l_do_not_load_prop
\prop_set_from_keyval:Nn \l_do_not_load_prop {%
circuitikz={Problem~with~circuit.ee},%
bigfoot={Problem~with~hyperref},%
footnote={Problem~with~hyperref},%
hypcap={Out-dated~due~to~caption},%
subfiles={Not (yet) compatible with pagestyles, gives Warning}%
}%
%% (Example) Store keys of \prop in \clist.
%\cs_new:Npn \get_keys #1#2 {%
% \clist_put_right:Nn \l_do_not_load_clist {#1}
%}%
%\prop_map_function:NN \l_do_not_load_prop \get_keys
\makeatletter%
\cs_new:Npn \check_do_not_load_packages #1#2 {%
\@ifpackageloaded{#1}{%
\msg_set:nnnn {tum-physics} {check_package/do_not_load} {%
Do~not~load~the~package~#1~(#2).%
}{}%
\msg_warning:nn {tum-physics} {check_package/do_not_load}%
}{}%
}%
%% Load multiple packages
\cs_new_protected:Npn \check_if_multiple_package_loaded:n #1 {%
\@ifpackageloaded{#1}{}{%
\clist_put_right:Nn \l_temp_load_packages_clist {#1}%
}%
}%
%% Packages which must be loaded strictly after <...>-package
\prop_new:N \l_package_end_prop
%% Package order check
\prg_new_conditional:Nnn \@TUM@ifpackageloaded:n {p,T,F,TF}{%
\use:c {@ifpackageloaded} {#1} {\prg_return_true:} {\prg_return_false:}%
}%
\bool_new:N \l_if_all_packages_loaded_bool%
\cs_new_protected:Npn \check_if_all_packages_loaded:n #1 {% True if all loaded
\bool_set:Nn \l_if_all_packages_loaded_bool {%
\bool_lazy_all_p:n {%
{\@TUM@ifpackageloaded_p:n {#1}}%
{\l_if_all_packages_loaded_bool}%
}%
}%
}%
\bool_new:N \l_if_one_package_loaded_bool%
\cs_new_protected:Npn \check_if_one_package_loaded:n #1 {% True if one loaded
\bool_set:Nn \l_if_one_package_loaded_bool {%
\bool_lazy_any_p:n {%
{\@TUM@ifpackageloaded_p:n {#1}}%
{\l_if_one_package_loaded_bool}%
}%
}%
}%
%% \TUMRequirePackage[options][strictly after]{package}
\clist_new:N \l_load_packages_clist
\int_new:N \l_load_packages_int
\NewDocumentCommand{\TUMRequirePackage}{soom}{%
\IfBooleanTF{#1}{%
\msg_redirect_name:nnn {tum-physics} {require_package/loaded_before_by_you} {none}%
\msg_redirect_name:nnn {tum-physics} {require_package/loaded_before_by_other} {none}%
\msg_redirect_name:nnn {tum-physics} {require_package/requirements_not_fulfilled} {none}%
\msg_redirect_name:nnn {tum-physics} {require_package/no_package} {none}%
\msg_redirect_name:nnn {tum-physics} {require_package/some_loaded_before} {none}%
}{}%
\clist_set:Nn \l_load_packages_clist {#4}%
\clist_remove_duplicates:N \l_load_packages_clist%
\int_set:Nn \l_load_packages_int {\clist_count:N \l_load_packages_clist}%
\int_compare:nNnTF {\int_use:N \l_load_packages_int} = {1}{%
\bool_if_exist:cTF {l_#4_bool} {}{%
\bool_new:c {l_#4_bool}%
\bool_set_false:c {l_#4_bool}%
}%
\@ifpackageloaded{#4}{%
\bool_if:cTF {l_#4_bool}{%
\msg_set:nnnn {tum-physics} {require_package/loaded_before_by_you} {%
Package~{#4}~already~loaded~before~by~you~with~options~[%
\clist_use:cnnn {l_#4_options_clist} {,}{,}{,}%
]%
}{}%
\msg_warning:nn {tum-physics} {require_package/loaded_before_by_you}%
}{%
\msg_set:nnnn {tum-physics} {require_package/loaded_before_by_other} {%
Package~{#4}~already~loaded~by~other~package.%
}{}%
\msg_warning:nn {tum-physics} {require_package/loaded_before_by_other}%
}%
}{%
\bool_set_true:c {l_#4_bool}%
\prop_get:NnN \l_package_before_prop {#4} \l_package_before_tl%
\bool_set:Nn \l_if_package_before_bool {%
\bool_lazy_any_p:n {%
{\quark_if_no_value_p:N \l_package_before_tl}%
{\tl_if_empty_p:N \l_package_before_tl}%
}%
}%
\bool_if:NTF \l_if_package_before_bool {}{%
% Warning (if): requirements not fulfilled ("package loaded to late")
\msg_set:nnnn {tum-physics} {require_package/requirements_not_fulfilled} {%
Package~{#4}~loaded~to~late.~This~package~must~be~loaded~before~{\tl_use:N \l_package_before_tl}.%
}{}%
\clist_new:c {l_#4_before_clist}%
\clist_set:cV {l_#4_before_clist} \l_package_before_tl%
\bool_set_false:N \l_if_one_package_loaded_bool%
\clist_map_function:cN {l_#4_before_clist} \check_if_one_package_loaded:n%
\bool_if:nTF{\l_if_one_package_loaded_bool}{%
\msg_warning:nn {tum-physics} {require_package/requirements_not_fulfilled}%
}{}%
}%
\prop_get:NnN \l_package_after_prop {#4} \l_package_after_tl
\bool_set:Nn \l_if_package_after_bool {%
\bool_lazy_any_p:n {%
{\quark_if_no_value_p:N \l_package_after_tl}%
{\tl_if_empty_p:N \l_package_after_tl}%
}%
}%
\bool_if:NTF \l_if_package_after_bool {}{%
% Warning (if): requirements not fulfilled ("package loaded to early")
\msg_set:nnnn {tum-physics} {require_package/requirements_not_fulfilled} {%
Package~{#4}~loaded~to~early.~This~package~must~be~loaded~after~{\tl_use:N \l_package_after_tl}.%
}{}%
\clist_new:c {l_#4_after_clist}%
\clist_set:cV {l_#4_after_clist} \l_package_after_tl%
\bool_set_true:N \l_if_all_packages_loaded_bool%
\IfNoValueOrEmptyTF{#3}{}{%
\clist_remove_all:cn {l_#4_after_clist} {#3}%
}%
\clist_map_function:cN {l_#4_after_clist} \check_if_all_packages_loaded:n%
\IfNoValueOrEmptyTF{#3}{}{%
\clist_put_right:cn {l_#4_after_clist} {#3}%
}%
\bool_if:nTF {\l_if_all_packages_loaded_bool} {}{%
\msg_warning:nn {tum-physics} {require_package/requirements_not_fulfilled}%
}%
}%
\TUMPassOptionsToPackage*{#2}{#4}%
\IfNoValueOrEmptyTF{#3}{%
\RequirePackage{#4}% #4 = \clist_use:Nnnn \l_load_packages_clist {,}{,}{,}
}{%
\@ifpackageloaded{#3}{%
\RequirePackage{#4}%
}{%
\AfterAtEndOfPackage{#3}{\RequirePackage{#4}}%
\prop_put:Nnn \l_package_end_prop {#4} {#3}%
}%
}%
}%
}{}%
\int_compare:nNnTF {\int_use:N \l_load_packages_int} < {1}{%
\msg_set:nnnn {tum-physics} {require_package/no_package} {%
Select~a~package.%
}{}%
\msg_warning:nn {tum-physics} {require_package/no_package}%
}{}%
\int_compare:nNnTF {\int_use:N \l_load_packages_int} > {1}{%
\clist_clear:N \l_temp_load_packages_clist%
\clist_map_function:NN \l_load_packages_clist \check_if_multiple_package_loaded:n%
\int_compare:nNnTF {\clist_count:N \l_load_packages_clist} = {\clist_count:N \l_temp_load_packages_clist}{%
\RequirePackage{#4}%
}{%
\msg_set:nnnn {tum-physics} {require_package/some_loaded_before} {%
Some~packages~from~{\clist_use:Nnnn \l_load_packages_clist {,}{,}{,}}~are~already~loaded.~Loaded~only~{\clist_use:Nnnn \l_temp_load_packages_clist {,}{,}{,}}.%
}{}%
\msg_warning:nn {tum-physics} {require_package/some_loaded_before}%
\RequirePackage{\clist_use:Nnnn \l_temp_load_packages_clist {,}{,}{,}}%
}%
}{}%
\IfBooleanTF{#1}{%
\msg_redirect_name:nnn {tum-physics} {require_package/loaded_before_by_you} {warning}%
\msg_redirect_name:nnn {tum-physics} {require_package/loaded_before_by_other} {warning}%
\msg_redirect_name:nnn {tum-physics} {require_package/requirements_not_fulfilled} {warning}%
\msg_redirect_name:nnn {tum-physics} {require_package/no_package} {warning}%
\msg_redirect_name:nnn {tum-physics} {require_package/some_loaded_before} {warning}%
}{}%
}%
%% \TUMPassOptionsToPackage[strictly if package(s) already loaded]{options}{package}
\bool_new:N \l_if_noValue_or_empty_bool%
\bool_set_true:N \l_if_noValue_or_empty_bool%
\NewDocumentCommand{\TUMPassOptionsToPackage}{somm}{%
\IfBooleanTF{#1}{%
\msg_redirect_name:nnn {tum-physics} {pass_optoins_to_package/requirements_not_fulfilled} {none}%
\msg_redirect_name:nnn {tum-physics} {pass_optoins_to_package/options_passed_to_late} {none}%
% \msg_redirect_module:nnn { tum-physics } { warning } { none }% all
}{}%
\bool_set_true:N \l_if_noValue_or_empty_bool%
\IfNoValueOrEmptyTF{#2}{%
\bool_set_true:N \l_if_noValue_or_empty_bool%
}{%
\msg_set:nnnn {tum-physics} {pass_optoins_to_package/requirements_not_fulfilled} {%
The~option(s)~[#3]~for~this~package~{#4}~can~not~be~set,~because~{#2}~is(are)~not~loaded~yet.~%
}{}%
\clist_if_exist:cTF {l_#4_option_set_after_clist} {}{\clist_new:c {l_#4_option_set_after_clist}}%
\clist_set:cn {l_#4_option_set_after_clist} {#2}%
\bool_set_true:N \l_if_all_packages_loaded_bool%
\clist_map_function:cN {l_#4_option_set_after_clist} \check_if_all_packages_loaded:n
\bool_if:nTF{\l_if_all_packages_loaded_bool}{%
\bool_set_true:N \l_if_noValue_or_empty_bool%
}{%
\bool_set_false:N \l_if_noValue_or_empty_bool%
\msg_warning:nn {tum-physics} {pass_optoins_to_package/requirements_not_fulfilled}%
}%
}%
\clist_if_exist:cTF {l_#4_options_clist} {}{\clist_new:c {l_#4_options_clist}}%
\bool_if:NTF \l_if_noValue_or_empty_bool {%
\@ifpackageloaded{#4}{%
\msg_set:nnnn {tum-physics} {pass_optoins_to_package/options_passed_to_late} {%
The option(s)~[#3]~could~not~be~passed~to~package~{#4},~because~it~was~already~loaded.%
}{}%
\msg_warning:nn {tum-physics} {pass_optoins_to_package/options_passed_to_late}%
}{%
\IfValueTF{#3}{%
\clist_put_right:cn {l_#4_options_clist} {#3}%
}{}%
\clist_if_empty:cTF {l_#4_options_clist} {} {%
\PassOptionsToPackage{\clist_use:cnnn {l_#4_options_clist} {,}{,}{,}}{#4}%
}%
}%
}{}%
\IfBooleanTF{#1}{%
\msg_redirect_name:nnn {tum-physics} {pass_optoins_to_package/requirements_not_fulfilled} {warning}%
\msg_redirect_name:nnn {tum-physics} {pass_optoins_to_package/options_passed_to_late} {warning}%
}{}%
}%
\makeatother%
\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{mmm}{%
\IfNoValueTF{#1}{#2}{%
\tl_if_empty:nTF {#1} {#2} {#3}%
}%
}%
%% --------------------- DocumentCommand: TUM@ifpackageloaded ---------------------
\makeatletter%
\msg_new:nnn {tum-physics} {if_package_loaded/optional_argument_unknown} {}%
\msg_new:nnn {tum-physics} {if_package_loaded/can_not_set_settings} {}%
\NewExpandableDocumentCommand{\TUM@ifpackageloaded}{O{normal}O{and}mmm}{%
\str_set:Nn \l_optional_argument_one_str {#1}%
\str_set:Nn \l_optional_argument_two_str {#2}%
\str_case_e:nnTF {\l_optional_argument_one_str} {{setting}{}{setting=true}{}{true}{}} {%
\str_set:Nn \l_optional_argument_one_str {setting=true}%
}{}%
\str_case_e:nnTF {\l_optional_argument_one_str} {{setting=false}{}{false}{}} {%
\str_set:Nn \l_optional_argument_one_str {setting=false}%
}{}%
\clist_set:Nn \l_if_clist {#3}%
\bool_set_true:N \l_optional_argument_two_bool%
\str_case_e:nnTF {\l_optional_argument_two_str}{%
{and}{\bool_set_true:N \l_optional_argument_two_bool}%
{or}{\bool_set_false:N \l_optional_argument_two_bool}%
}{}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/optional_argument_unknown} {%
The~optional~argument~[#2]~is~not~defined.~Proceeded~with~[and].%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/optional_argument_unknown}%
}%
\bool_if:nTF {\l_optional_argument_two_bool}{%
\bool_set_true:N \l_if_all_packages_loaded_bool%
\clist_map_function:NN \l_if_clist \check_if_all_packages_loaded:n%
\str_case_e:nnTF {\l_optional_argument_one_str}{%
{setting=false}{%
\bool_if:nTF {\l_if_all_packages_loaded_bool}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/can_not_set_settings} {%
Can~not~set~settings,~because~package/s~{#3}~was/were~loaded~(or/and~package/s~(should)~not~(be)~loaded~normally).%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/can_not_set_settings}%
#4%
}{#5}%
}%
{setting=true}{%
\bool_if:nTF {\l_if_all_packages_loaded_bool}{#4}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/can_not_set_settings} {%
Can~not~set~settings,~because~package/s~{#3}~was/were~not~loaded~(or/and~package/s~(should~be)~loaded~normally).%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/can_not_set_settings}%
#5%
}%
}%
}{}{%
\str_case_e:nnTF {\l_optional_argument_one_str} {{normal}{}{}{}} {}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/optional_argument_unknown} {%
The~optional~argument~[#1]~is~not~defined.~Proceeded~with~[normal].%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/optional_argument_unknown}%
}%
\bool_if:nTF {\l_if_all_packages_loaded_bool}{#4}{#5}%
}%
}{%
\bool_set_false:N \l_if_one_package_loaded_bool%
\clist_map_function:NN \l_if_clist \check_if_one_package_loaded:n%
\str_case_e:nnTF {\l_optional_argument_one_str}{%
{setting=true}{%
\bool_if:nTF {\l_if_one_package_loaded_bool}{#4}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/can_not_set_settings} {%
Can~not~set~settings,~because~one~package/s~{#3}~was/were~not~loaded~(or/and~package/s~(should~be)~loaded~normally).%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/can_not_set_settings}%
#5%
}%
}%
{setting=false}{%
\bool_if:nTF {\l_if_one_package_loaded_bool}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/can_not_set_settings} {%
Can~not~set~settings,~because~one~package/s~{#3}~was/were~loaded~(or/and~package/s~(should)~not~(be)~loaded~normally).%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/can_not_set_settings}%
#4%
}{#5}%
}%
}{}{%
\str_case_e:nnTF {\l_optional_argument_one_str} {{normal}{}{}{}} {}{%
\msg_set:nnnn {tum-physics} {if_package_loaded/optional_argument_unknown} {%
The~optional~argument~[#1]~is~not~defined.~Proceeded~with~[normal].%
}{}%
\msg_warning:nn {tum-physics} {if_package_loaded/optional_argument_unknown}%
}%
\bool_if:nTF {\l_if_one_package_loaded_bool}{#4}{#5}%
}%
}%
}%
\makeatother%
%% ----------------------------------- Options ------------------------------------
%% Option (debug):
\makeatletter%
\bool_if:NTF \l_debug_key_bool {%
\TUMRequirePackage[][xcolor]{showframe}%
\AtBeginDocument{%
\TUMRequirePackage{lipsum}%
\TUMRequirePackage{layout}%
\listfiles%
\@ifpackageloaded{array}{%
\showcols%
}{}%
}%
}{}%
\makeatother%
\bool_if:NTF \l_todo_key_bool {%
\WarningsOff[todonotes]%
}{%
\TUMPassOptionsToPackage{disable}{todonotes}%
}%
\bool_if:NTF \l_notecolumn_key_bool {%
%% scrlayer-notecolumn = Control note columns parallel to the main text
\TUMRequirePackage[][scrlayer-scrpage]{scrlayer-notecolumn}%
}{}%
\bool_if:NTF \l_printlist_key_bool {%
\AtBeginDocument{%
\TUMRequirePackage{seqsplit}%
\listfiles%
}%
\AtEndDocument{\printfilelist}%
\NewDocumentCommand{\printfilelist}{}{%
\cleardoublepage%
\addchap{\printfilelistname}%
\setlength{\LTleft}{\fill}%
\setlength{\LTright}{\fill}%
\begin{longtable}{@{}%
>{\ttfamily}%
L{0.3\textwidth-\tabcolsep}%
L{\widthof{9999/99/99}}%
>{\raggedright}%
p{0.7\textwidth-\widthof{9999/99/99}-3\tabcolsep}%
@{}}%
\toprule%
\multicolumn{1}{@{}l}{\bfseries File~name} & \multicolumn{1}{c}{\bfseries Date} & \bfseries File~info%
\tabularnewline%
\midrule%
\endhead%
\bottomrule%
\endfoot%
\TUM_print_filelist:%
\end{longtable}%
}%
\tl_new:N \l_TUM_filelist_body_tl%
\tl_new:N \l_TUM_fileinfo_tl%
\cs_new_protected:Npn \TUM_print_filelist: {%
\clist_map_inline:cn {@filelist}{%
\TUM_print_fileinfo:n {##1}%
}%
\tl_use:N \l_TUM_filelist_body_tl%
}%
\cs_new_protected:Npn \TUM_print_fileinfo:n #1 {%
\regex_match:nnT { \.(sty|cls|tex|clo|fd|cfg|bbx|cbx|lbx|ldf|def|hak)\Z } {#1}{%
\TUM_print_pkginfo:n {#1}%
}%
}%
\cs_new_protected:Npn \TUM_print_pkginfo:n #1 {%
\tl_set_eq:Nc \l_TUM_fileinfo_tl {ver@#1}%
\tl_replace_once:Nnn \l_TUM_fileinfo_tl {~} {&}%
\tl_put_right:Nx \l_TUM_filelist_body_tl {%
\exp_not:N \seqsplit{#1}%
&%
\exp_not:V \l_TUM_fileinfo_tl%
\exp_not:N \tabularnewline%
}%
}%
}{}%
\ExplSyntaxOff%
\makeatletter%
\@ifundefined{printfilelist}{}{%
\AtBeginDocument{%
\TUM@ifpackageloaded[setting]{babel}{%
\AfterEndPreamble{%
\TUM@addto@extras@renew{american,english}{printfilelistname}{Used Class, Packages and other Files}%
\TUM@addto@extras@renew{naustrian,ngerman}{printfilelistname}{Verwendete Klasse, Packete und weitere Files.}%
}%
}{}%
}%
}%
\makeatother%
\ExplSyntaxOn%
%% ----------------------------------- Checks -------------------------------------
%% Check: Packages which must not be loaded
\AtEndPreamble{%
\prop_map_function:NN \l_do_not_load_prop \check_do_not_load_packages%
}%
%% Check: Packages which needed to be loaded strictly after <...>-package
\makeatletter%
\AtEndPreamble{%
\cs_new:Npn \check_requirements #1#2 {%
\@ifpackageloaded{#2}{}{%
\msg_set:nnnn {tum-physics} {check_package/requirements_not_fulfilled} {%
Package~{#1}~could~not~be~loaded.~For~this~package~you~have~to~load~{#2}.%
}{}%
\msg_warning:nn {tum-physics} {check_package/requirements_not_fulfilled}%
}%
}%
\prop_map_function:NN \l_package_end_prop \check_requirements%
}%
\makeatother%
\ExplSyntaxOff%
%% ================================================================================
%% ================================================================================
%% ======================= Loading Packages (ExplSyntaxOff) =======================
%% ================================================================================
%% ================================================================================
\typeout{Possible optimizations: glossaries, biblatex, listings, theorems}%
\typeout{TODO: biblatex (ev. ieee (changes names))}
\typeout{TODO: theorem (Improvements, style)}
\typeout{TODO: listings package (Improvements, e.q. Python)}
\typeout{TODO: glossaries(-extra) (Improvements)}
\typeout{TODO: titelpage + header translate to englisch}
\typeout{Problem with: etex - paracol (can not be loaded at the same time, use first)}%
%% not loaded: l3regex, l3docstrips, l3packages, xfp, xtemplate, titlesec,
%% marginnote, perpage, hyphenat, extdash, cmap, rotating, dcolumn,
%% parskip, alltt, setspace, moreverb, beramono, fullpage, tabulary,
%% bold-extra, blindtext, scrextend, tasks, eurosym, marvosym, tabu,
%% gensymb, mathtext, numprint, luatexja, luatexja-fontspec, luatextra
%% not necessary: textcomp (in 2020 latex-core distribution, but irrelevant)
%% not tested througly: microtype
%% --------------------------------------------------------------------------------
%% amssymb, amstext, sansmath = Mathematische Standardpakete
%% amsmath [intlimits, sumlimits, reqno] = AMS mathematical facilities for LaTeX
%% Options: integral/sum limits above/below
%% leqno (Nummer links), reqno (Nummer rechts), fleqn,%
%% amsmath = amstext, amsbsy, amsopn
\TUMRequirePackage[%
intlimits,%
sumlimits,%
reqno%
]{amsmath}%
\TUMRequirePackage{amssymb,amsthm}%
%% mathtools [showonlyrefs] = Mathematical tools to use with amsmath
\TUMRequirePackage[%
showonlyrefs%
]{mathtools}%
%% nccmath = Erweiterte mathematische Faehigkeiten
\TUMRequirePackage[][hyperref]{nccmath}%
%% mathrsfs = Extended mathematics capabilities
\TUMRequirePackage{mathrsfs}%
%% aligned-overset = z.B. \overset{...}&{=}
\TUMRequirePackage{aligned-overset}%
%% tensor = Typeset tensors (there is and can't be no conflict with other packages)
\TUMRequirePackage{tensor}%
%% physics = Erweiterung um physikalische/mathematische Inhalte
\TUMRequirePackage{physics}%
%% babel [naustrian,english] = Multilingual support for Plain TeX or LaTeX
%% [..., first language]
\TUMRequirePackage[%
naustrian,%
main=american%
]{babel}%
%% (Re)update babel language settings
\makeatletter\AfterAtEndOfPackage{tum-physics}{\AtEndPreamble{\AtBeginDocument{\AfterEndPreamble{\selectlanguage{\bbl@main@language}}}}}\makeatother%
%% Get main-language:
\ExplSyntaxOn%
\makeatletter%
\str_new:N \l_main_language_str%
\exp_args:NNo \str_set:Nn \l_main_language_str {\bbl@main@language}%
%% \addto\extras{...} for multiple languages
\clist_new:N \l_TUM_addto_extras_clist
\NewDocumentCommand{\TUM@addto@extras}{mm}{%
\clist_set:Nn \l_TUM_addto_extras_clist {#1}%
\clist_map_inline:Nn \l_TUM_addto_extras_clist {%
\expandafter\addto\csname extras##1\endcsname{%
#2%
}%
}%
}%
\NewDocumentCommand{\TUM@addto@extras@renew}{mmm}{%
\@ifundefined{#2}{%
\expandafter\newcommand\expandafter*\csname #2\endcsname{#3}%
}{}%
\TUM@addto@extras{#1}{%
\expandafter\renewcommand\expandafter*\csname #2\endcsname{#3}%
}%
}%
\ExplSyntaxOff%
\makeatother%
%% inputenc = Accept different input encodings
\ifluatex%
\TUMRequirePackage{fontspec}%
\else%
\TUMRequirePackage[%
utf8%
]{inputenc}%
\fi%
%% ulem = (redefines \@empty, also zur Sicherheit vor Koma-Script)
\TUMRequirePackage[%
normalem%
]{ulem}%
%% everysel = Provides hooks into \selectfont
\TUMRequirePackage{everysel}%
%% ragged2e = Alternative versions of "ragged"-type commands
\TUMRequirePackage[%
originalcommands,%
newparameters,%
]{ragged2e}%
%% scrlayer-scrpage = Define and manage page styles
\TUMRequirePackage[%
automark,% atuomark statt manualmark (kann nachher noch geaendert werden immer)%
ilines,% Standard für die Ausrichtung der Trennlinien von Kopf- und Fusszeilen%
pagestyleset=KOMA-Script,% Standardeinstellung der Kopf- und Fusszeilen%
autooneside=false% Erlaube auch einseitig \automark[section]{chapter}%
]{scrlayer-scrpage}%
\TUMRequirePackage{scrdate}%
\TUMRequirePackage{scrtime}%
\TUMRequirePackage{scrwfile}% for tumctoc.sty (or ? morewrites.sty)
%% tocbasic = Management of tables/lists of contents (and the like)
\makeatletter%
\@ifundefined{KOMAClassName}{%
\TUMRequirePackage{tocbasic}%
}{%
\TUMRequirePackage*{tocbasic}% (should be) already loaded with KomaClass
}%
\makeatother%
%% fontenc (Standard - 2020, "not a package anymore")
\ifluatex\else%
\TUMRequirePackage[%
T1%
]{fontenc}%
\fi%
%% ================== Definition, etc. of the used font's =========================
%% --------------------------- Latin Modern font family ---------------------------
\ifluatex%
\setmainfont{Latin Modern Roman}%
%\setmainfont{Helvetica}%
\defaultfontfeatures{Ligatures=TeX}%
\else%
%% lmodern = Latin Modern fotns
\TUMRequirePackage{lmodern}%
%% helvet [scaled] = Load Helvetica, scaled
\TUMRequirePackage[%
scaled%
]{helvet}%
\fi%
%% ------------------------- Default fonts of the document ------------------------
\ifluatex\else%
%% LM Roman
\renewcommand{\rmdefault}{lmr}%
%% LM Mono
\renewcommand{\ttdefault}{lmtt}%
%% LM Sans / Helvetica
%\renewcommand{\sfdefault}{lmss}%
\renewcommand{\sfdefault}{phv}%
\fi%
%% Default
\renewcommand{\familydefault}{\rmdefault}%
%% --------------------------- + bb-font in math mode ----------------------------
%% dsfont = \mathds{}, for example 1 (identity matrix) (more ev. {newtxmath})
\TUMRequirePackage{dsfont}%
%% ---------------------------- Upright Greek letters -----------------------------
%% upgreek = upright greek letters (z.B. \upmu)
\TUMRequirePackage{upgreek}%
%% ------------------------- Typographical perfection(s) --------------------------
%% microtype = subliminal refinements towards typographical perfection
%% after: font(s),
\TUMRequirePackage[%
babel=true,%
]{microtype}%
%% url = Verbatim with URL-sensitive line breaks
\TUMRequirePackage[%
hyphens,%
]{url}%
%% biber = with: --validate-control --convert-control %
\TUMRequirePackage[%
%% default backend of biblatex (bibtex, bibtex8)
backend=biber,%
%% .cbx-file numeric style in the "Text", when using \cite (numeric, numeric-comp)
citestyle=numeric,%
%% .bbx-file numeric style in the bibliography (numeric, numeric-comp)
bibstyle=numeric,%
%% citation order ([nty ... sort by name, title, year], ...
%% or declare a sorting scheme with \DeclareSortingScheme)
sorting=none,%
%% style loads .cbx,.bbx-file at once (overrides bib/cite), ieee=numeric/unsorted
%style=ieee,% changes names...
%% changes are possible here:
natbib=true,% aliases for citation commands, like the natbib package
backref=true,% reference back from the bibliography
backrefstyle=two,% (e. g. two, three)
language=auto,% language for the whole bibliograpies,
% will be set by the otherlanguage-environment:
autolang=other,% if you want to change the language
alldates=year,% basicly only the year
dateabbrev=false,% disable abbreviations
url=true,% urls true
doi=true,% doi true
urldate=long,%
%% refsection=section
%% datamodel=dbmauthoryear% .dbx-file (additional definitions)
]{biblatex}%
%% csquotes = Context sensitive quotation facilities
%% first language ... main
%% naustrian alias for: austrian
%% english: american
\TUMRequirePackage[%
autostyle=true,%
english=american,%
austrian=quotes,%
german=quotes,%
]{csquotes}%
%% array = Extending the array and tabular environments
%% --> needed by authors (siunitx)
\TUMRequirePackage{array}%
%% siunitx = A comprehensive (SI) units package
\TUMRequirePackage{siunitx}%
%% setspace = Set space between lines
%% default: \singlespacing (ev. \onehalfspacing, if desired)
\TUMRequirePackage[%
singlespacing%
]{setspace}%
%% graphics = Standard LaTeX graphics
\TUMRequirePackage{graphics}%
%% lscape = Place selected parts of a document in landscape
\TUMRequirePackage{lscape}%
%% pdflscape = Make landscape pages display as landscape
\TUMRequirePackage{pdflscape}%
%% supertabular = A multi-page tables package
\TUMRequirePackage{supertabular}%
%% tabularx = Tabulars with adjustable-width columns
\TUMRequirePackage{tabularx}%
%% booktabsPublication quality tables in LaTeX
\TUMRequirePackage{booktabs}%
%% longtable = Allow tables to flow over page boundaries
\TUMRequirePackage{longtable}%
%% multirow = Create tabular cells spanning multiple rows
\TUMRequirePackage[%
longtable%
]{multirow}%
%% Colors: needs booktabs, must be loaded before hyperref:
\TUMRequirePackage{packages/tumcolors}%
%% graphicx = Enhanced support for graphics
\TUMRequirePackage{graphicx}%
%% graphbox = Extension of graphicx (loads graphicx)
\TUMRequirePackage{graphbox}%
%% nicefrac = Typeset in-line fractions in a "nice" way
\TUMRequirePackage{nicefrac}%
%% xfrac = Split-level fractions in LaTeX2ε*
\TUMRequirePackage{xfrac}%
%% subfig [lofdepth] = Figures broken into subfigures (not recommended)
%\RequirePackage[lofdepth,labelformat=simple,listofformat=subsimple,%
% subrefformat=subsimple,labelsep=period]{subfig}%
%% subfloat [countmax] = Sub-numbering for figures and tables (not recommended)
%\RequirePackage[countmax]{subfloat}%
%% caption [hypcap=true] = Customising captions in floating environments
%% --> loads: caption3
\TUMRequirePackage[%
hypcap=true%
%margin=10pt% margin left and right
]{caption}%
%% subcaption [list=true,hypcap=true] = Support for sub-captions
\TUMRequirePackage[%
list=true,%
hypcap=true%
]{subcaption}%
%% pdfpages = Include PDF documents in LaTeX
\TUMRequirePackage{pdfpages}%
%% enumitem = Control layout of itemize, enumerate, description
\TUMRequirePackage{enumitem}%
%% easylist [ampersand] = Lists using a single active character
\TUMRequirePackage[%
ampersand%
]{easylist}%
%% tikz,pgf = Create PostScript and PDF graphics in TeX
%% (tikz loads pgf)
%% (pgfplotstable loads pgfplots, pgf)
%% Most important commands:
%% \node (name) [object] at (coordinate) {caption};
%% \coordinate (name) at (coordinate);
%% \draw (coordinate) -- (coordinate) to [element] (coordinate);
\TUMRequirePackage{tikz}%
\TUMRequirePackage{pgfplotstable}%
%% listings = Typeset source code listings using LaTeX
\TUMRequirePackage[%
procnames%
]{listings}%
%% todonotes = Marking things to do in a LaTeX document
\ExplSyntaxOn%
\bool_if:NTF \l_todo_key_bool {%
\TUMRequirePackage[%
colorinlistoftodos,%
textsize=tiny%
]{todonotes}%
}{}%
\ExplSyntaxOff
%% marginnote = Notes in the margin, even where \marginpar fails
%% needed for todonotes (Better would be also to load scrlayer-notecolumn
%% if one want to write important stuff into the margin.)
\makeatletter%
\ExplSyntaxOn%
\bool_lazy_or:nnTF {\l_todo_key_bool} {\l_notecolumn_key_bool} {%
\TUMRequirePackage{marginnote}%
\TUM@ifpackageloaded[setting]{marginnote}{%
\renewcommand{\marginpar}{\marginnote}%
%\reversemarginpar%
}{}%
}{}%
\ExplSyntaxOff%
\makeatother%
%% tcolorbox = Coloured boxes, for LaTeX examples and theorems, etc.
\TUMRequirePackage{verbatim}%
\TUMRequirePackage{trimspaces}%
\TUMRequirePackage{environ}%
\TUMRequirePackage{aliascnt}% for \autoref
\TUMRequirePackage{tcolorbox}%
%% mhchem = Typeset chemical formulae/equations and Risk and Safety phrases
%% --> older version of chemformula
%% [version=4]
%% chemformula = Command for typesetting chemical formulas and reactions
\TUMRequirePackage{chemformula}%
%% chemgreek = Upright Greek letters in chemistry
\TUMRequirePackage{chemgreek}%
%% chemmacros = A collection of macros to support typesetting chemistry documents
\TUMRequirePackage{chemmacros}%
\chemsetup{greek=upgreek}%
%% nicematrix = Improve the typesetting of mathematical matrices with PGF
\TUMRequirePackage{nicematrix}%
%% geometry [pass] = Flexible and complete interface to document dimensions
%% --> pass: only loading, e.q. for addtotoc (pdf)
\TUMRequirePackage[%
pass%
]{geometry}%
%% datetime = Change format of \today with commands for current time
%% --> (for e. g. \monthname + scrdate + scrtime)
\TUMRequirePackage{datetime}%
%% scrhack = Fixes mistakes from important packages
\TUMRequirePackage{scrhack}%
%% float = Improved interface for floating objects
\TUMRequirePackage{float}%
%% hyperref [...] = for hyperlinks
%% bookmark-commands for hyperref/bookmark
\makeatletter%
\newcommand{\pdfauthor}[1]{\gdef\@pdfauthor{#1}}%
\newcommand{\@pdfauthor}{\@latex@warning@no@line{No \noexpand\pdfauthor given}}%