summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lectureslides/lectureslides.sty
blob: 8c9cfc4899fd3489032654a7cf4675097d64afa1 (plain)
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
%
% lectureslides 
% version 0.1
% 2021/03/15
%
% Taihao Zhang (taihao.de)
% 15 March, 2021
%
% This work is licensed under the Creative Commons Attribution 4.0 International License. 
% To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ 
% or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
%
% For contribution or suggestions, please contact me at t@taihao.de
%

\newcommand{\thispackage}{lectureslides}

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{\thispackage}[2021/03/14 \thispackage]

\RequirePackage{xparse}
\RequirePackage{pdfpages
    % , parskip
    , tocloft
    % , tikz
    , hyperref}
\renewcommand{\cftdot}{}
\renewcommand{\cftsecfont}{\mdseries}
\renewcommand{\cftsecafterpnum}{\vspace{-3.25mm}}

% Not really a variable meant to be changed, leaving it in for now
\newcommand*{\toclevel}{section}

\newcommand{\orientation}{, landscape}
\DeclareOption{portrait}{\renewcommand{\orientation}{}}
\DeclareOption{landscape}{\renewcommand{\orientation}{, landscape}}
\DeclareOption*{\PackageWarning{\thispackage}{Unknown option ‘\CurrentOption’}}
\ProcessOptions\relax

\newcommand{\createdby}[1]{Zusammengestellt von #1 am \today.}

\NewDocumentCommand{\course}{o m}{%
  {%
      \noindent\LARGE\bfseries\sffamily #2%
      \IfNoValueTF{#1}%
        {}%
        {\footnote{\createdby{#1}}}%
      \par%
  }%
}

\newcommand{\tocline}[1]{\arabic{\toclevel}.~#1}

\newcommand*{\lecturetitle}[1]{%
    \addtocounter{\toclevel}{1}%
    \newpage\phantomsection%
    \addcontentsline{toc}{\toclevel}{\tocline{#1}}%
}

\NewDocumentCommand{\lectureslides}{o m}{%
    \IfNoValueTF{#1}%
    {\includepdf[pages=- \orientation]{#2}}%
    {\includepdf[pages=-#1 \orientation]{#2}}%
}

\NewDocumentCommand{\lecture}{m o m}{%
    \lecturetitle{#1}\lectureslides[#2]{#3}%
}

\newcommand{\infotext}{%
Diese PDF mit Inhaltsverzeichnis und PDF-Kapiteln wurde erstellt, um ein einfacheres Lernen zu ermöglichen indem alle Folien übersichtlich an einem Ort organisiert sind.%
\par%
In geeigneten PDF-Readern wird ein Navigationsbereich angezeigt, sodass einfach zwischen den Kapiteln gewechselt werden kann. Alternativ sind die Überschriften im Inhaltsverzeichnis auch anklickbar.%
}