-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitworkshop.tex
250 lines (217 loc) · 6.91 KB
/
gitworkshop.tex
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
\documentclass[t,10pt]{beamer}
\beamertemplatenavigationsymbolsempty
\definecolor{GitRed}{RGB}{240, 60, 46}
\setbeamercolor{title}{bg=GitRed,fg=white}
\setbeamercolor{structure}{fg=black}
\setbeamertemplate{section in toc shaded}[default][40]
\setbeamercolor{itemize item}{fg=GitRed}
\setbeamercolor{section in toc}{bg=GitRed,fg=white}
\setcounter{tocdepth}{1}
\setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}
% allow copy & paste, make nice tilde
\usepackage[T1]{fontenc}
% do not use bitmap font
\usepackage{lmodern}
% Quotations
\usepackage{epigraph}
\setlength\epigraphwidth{10cm}
\setlength\epigraphrule{0pt}
\renewcommand{\epigraphsize}{\normalsize}
%\usepackage{etoolbox}
%\makeatletter
%\patchcmd{\epigraph}{\@epitext{#1}}{\itshape\@epitext{#1}}{}{}
%\makeatother
\usepackage{url}
\usepackage{relsize}
\usepackage{hyperref}
\hypersetup{colorlinks=true, urlcolor=structure.fg, linkcolor=structure.fg}
\renewcommand*{\UrlFont}{\ttfamily\footnotesize\relax}
% disable ligatures to ensure that
% hyphens (-) and especialy -- and ---
% are shown as is and not rendert as en/em dash
% important for cmds
\usepackage{microtype}
\DisableLigatures[-]{}
%\usepackage{bold-extra} % cmtt
%\renewcommand{\ttdefault}{cmtt}
%\usepackage{lmodern}
%\usepackage{pxfonts} % Palatino font
%%\usepackage{txfonts} % Times font
\makeatletter
\newcommand\handoutmode[1]{
\ifnum1=0#1
\gdef\beamer@currentmode{handout}
\usepackage{../handoutWithNotes}
\pgfpagesuselayout{4 on 1}[a4paper, landscape, border shrink=5mm]
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{headline}{%
\leavevmode%
\vspace{.5cm}
}
% define font of lstlisting
\lstset{
basicstyle=\small\ttfamily\bfseries, %\tiny\ttfamily,
tabsize=2,
extendedchars=true,
breaklines=true,
%frame=single,
%stringstyle=\ttfamily,
showspaces=false,
showtabs=false,
xleftmargin=.25cm,
%framextopmargin=0pt,
%framexleftmargin=2pt,
%framexrightmargin=2pt,
%framexbottommargin=0pt,
backgroundcolor=\color{white},
showstringspaces=false
%morestring=[b][\color{blue}]",
%morestring=[d][\color{blue}]',
columns=fullflexible,
escapeinside={(*}{*)},
keepspaces=true,
upquote=true,
commentstyle=\color{red},
keywordstyle=\color{blue},
rulecolor=\color{gray}
% language=bash
}
%\lstloadlanguages{bash}
\else
\AtBeginSection[]{
\begin{frame}<*>{Outline}
\hspace{1.2em}
\begin{multicols}{2}
\frametitle{Outline}
\tableofcontents[currentsection] %,hideallsubsections]
\end{multicols}
\end{frame}
}
\addtocontents{toc}{\vskip -0.2cm}
\setbeamertemplate{footline}[text line]{%
\parbox{\linewidth}{\vspace*{-12pt}\textcolor{lightgray}{\inserttitle{} {\normalsize\ttfamily\textcopyright}\
https://github.com/segfault-trainings - Licensed for: CC-BY-SA-4.0
\hfill \insertpagenumber/\pageref{LastPage}}}
}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{title}{fg=white, bg=GitRed}
\setbeamercolor{frametitle}{fg=white, bg=GitRed}
\setbeamercolor{section in toc}{fg=black,bg=white}
\setbeamertemplate{frametitle}
{
\nointerlineskip
\begin{beamercolorbox}[sep=0.01cm,ht=1.8em,wd=\paperwidth]{frametitle}
%\vbox{}\vskip-4ex%
\hspace{.3cm}\strut\textbf\insertframetitle\strut
%\vskip-0.8ex%
\hfill$\vcenter{\hbox{\includegraphics{assets/diagrams/git-logo-small.pdf}}}$
\end{beamercolorbox}
}
% define font of lstlisting
\definecolor{listingbackground}{rgb}{0,0,0}
\lstset{
basicstyle=\small\ttfamily\bfseries\color{black}, %\tiny\ttfamily,
tabsize=2,
extendedchars=true,
breaklines=true,
frame=leftline,
%stringstyle=\ttfamily,
showspaces=false,
showtabs=false,
xleftmargin=.25cm,
%framextopmargin=0pt,
%framexleftmargin=2pt,
%framexrightmargin=2pt,
%framexbottommargin=0pt,
backgroundcolor=\color{white},
showstringspaces=false
%morestring=[b][\color{blue}]",
%morestring=[d][\color{blue}]',
columns=fullflexible,
escapeinside={(*}{*)},
keepspaces=true,
upquote=true,
commentstyle=\color{red},
keywordstyle=\color{blue},
rulecolor=\color{gray}
% language=bash
}
%\lstloadlanguages{bash}
\fi
}
\makeatother
\usepackage{catchfile}
\newcommand{\getenv}[2][]{%
\CatchFileEdef{\temp}{"|kpsewhich --var-value #2"}{}%
\if\relax\detokenize{#1}\relax\temp\else\let#1\temp\fi}
\usepackage{listings}
\getenv[\HANDOUT]{HANDOUT}
\handoutmode{\HANDOUT}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{color,soul}
\usepackage{tabto}
\usepackage{inconsolata}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{upquote}
\usepackage{vwcol}
\usepackage{lastpage}
% table spacings
\renewcommand{\arraystretch}{1.5}
%\setlength{\parskip}{10pt plus 1pt minus 1pt}
\newcommand{\slidetitle}{\frametitle{\thesection. \secname}\vspace{1em}}
\newcommand{\subslidetitle}{\frametitle{\thesection.\thesubsection\ \subsecname}\vspace{1em}}
\newcommand{\subsubslidetitle}{\frametitle{\thesection.\thesubsection.\thesubsubsection\ \subsubsecname}\vspace{1em}}
\newcommand{\cmd}[1]{\textcolor[HTML]{0000AA}{\texttt{\textbf{#1}}}}
\newcommand{\option}[3][1cm]{\item[]{\usebeamercolor[structure.fg]{section in head}\texttt{#2}}\tabto{#1}#3}
\newcommand{\opt}[3][2cm]{\item{\usebeamercolor[structure.fg]{section in head}\texttt{#2}}\tabto{#1}#3}
\def\braces#1{[#1]}
\def\lbrace#1{[#1}
\newcounter{exercise}
\newenvironment{exercise}[0]
{\begin{enumerate}\setcounter{enumi}{\theexercise}}
{ \setcounter{exercise}{\theenumi}\end{enumerate}}
% layout of title side
\makeatletter
\setbeamertemplate{title page}
{
\vspace{.6cm}
\center \includegraphics{assets/diagrams/git-logo-2color.pdf}
\vbox{}
\vfill
\begingroup
\centering
\begin{beamercolorbox}[sep=8pt,center]{title}
\usebeamerfont{title}\bf{\Huge{workshop}}\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip.5em\par
\begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\endgroup
\vfill
}
\makeatother
% end of layout of title side
\setbeamerfont{author}{size=\smaller}
\setbeamerfont{date}{size=\smaller}
\begin{document}
\title{git workshop}
\author{
\textbf{Authors} \\
Contributors @ \url{https://github.com/segfault-trainings} \\
\url{https://github.com/segfault-trainings/gitworkshop/graphs/contributors} \\
\vspace{3em}
\textbf{Licensed for:} Creative Commons Attribution Share Alike 4.0 International
\textbf{Version:} \today
}
%\date{Version: \today}
\frame{\titlepage}
\input{../index.tex}
\end{document}