latex.tex 14.5 KB
Newer Older
Stefan Heimersheim's avatar
Stefan Heimersheim committed
1
\documentclass[xcolor=dvipsnames]{beamer}
2
3
4
5
6
7
8
9

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
\usepackage{verbatim}
\usepackage{dtk-logos}
\usepackage{hyperref}
10
\usepackage{tikz}
Valentin Bruch's avatar
Valentin Bruch committed
11
\usetikzlibrary{backgrounds, fit, matrix, calc}
12
13
\usepackage{listings}
\usepackage{calc}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
14
\graphicspath{{figures/}{examples/}}
Lennart Klebl's avatar
Lennart Klebl committed
15
\usefonttheme{professionalfonts}
16

Lennart Klebl's avatar
Lennart Klebl committed
17
18
\setmonofont{FiraCode}

19
20
\usetheme{OSAK}

Stefan Heimersheim's avatar
Stefan Heimersheim committed
21
\lstset{
Lennart Klebl's avatar
Lennart Klebl committed
22
23
24
25
26
27
28
  basicstyle=\scriptsize\ttfamily,
  language={[LaTeX]TeX},
  texcsstyle=*\color{Mahogany}\bfseries,
  commentstyle=\itshape\color{RoyalBlue},
  keywordstyle=\color{RoyalBlue}\bfseries,
  moretexcs={lstset,testfont,testfont,subsubsection,paragraph,subsection ,color,sl,textcolor,lstinputlisting,newfontfamily,fontsize,HUGE,
    Gargantous,ShowCharInBox},
Stefan Heimersheim's avatar
Stefan Heimersheim committed
29
  morekeywords={center,document,flushleft,flushright,itemize,enumerate}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
30
31
}

32
33
34
35
\makeatletter
\newcommand\notsotiny{\@setfontsize\notsotiny{7}{8}}
\makeatother

36
37
38
39
40
41
42
43
44
45
46
% TODO Titel & Autoren anpassen!
\date{\today}
\title[\LaTeX-Workshop]{\LaTeX ist toll!}
\subtitle{wirklich!}
\author{OSAK-Mitglied \#42}
\institute[OSAK]{
  Open Source Arbeitskreis der \\
  Fachschaft Mathematik/Physik/Informatik an der RWTH Aachen \\
  und der Aachener Linux User Group
}

Stefan Heimersheim's avatar
Stefan Heimersheim committed
47
\newlength\marginwidth
Valentin Bruch's avatar
Valentin Bruch committed
48
\newcommand\marginbox[3][2pt]{
Valentin Bruch's avatar
Valentin Bruch committed
49
50
51
  % USAGE: \marginbox[margin width]{width}{content}
  % TODO: width is set manually such that it fits real width!
  \setlength\marginwidth{#1}
Valentin Bruch's avatar
Valentin Bruch committed
52
53
  \begin{tikzpicture}[even odd rule, scale=1]
    \node[anchor=north west] (text) {%
Valentin Bruch's avatar
Valentin Bruch committed
54
55
      \begin{minipage}{#2-2\marginwidth-10pt}%
        #3%
Valentin Bruch's avatar
Valentin Bruch committed
56
57
58
59
60
61
62
63
      \end{minipage}%
    };
    \begin{pgfonlayer}{background}
      \node[draw opacity=.5, draw=blue, line width=#1, inner sep=2pt, fit = (text)] {};
    \end{pgfonlayer}
  \end{tikzpicture}
}

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
\begin{document}

\begin{frame}{OSAK \LaTeX-Workshop}{Installation einer \TeX-Distribution}
  % TODO
  \Huge QR-CODE UND/ODER URL
\end{frame}

\begin{frame}
  \titlepage
\end{frame}

\begin{frame}{Inhaltsverzeichnis}
  \tableofcontents
\end{frame}

\section{Motivation}
\section{Dokumente mit \LaTeX}
\subsection{\TeX{}studio als Editor}
82
83
84
85
86
\subsection{Aufbau eines \LaTeX-Dokuments}
\OSAKthemenologo
\begin{frame}{Aufbau eines \LaTeX-Dokuments}
  \begin{columns}[T]
    \begin{column}{.35\textwidth}
Valentin Bruch's avatar
Valentin Bruch committed
87
      {\LaTeX} übersetzt\\
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
      Text in ein PDF
      \begin{itemize}
        \item Formatierung durch\\Befehle im Text
        \item Automatische Formatierung
      \end{itemize}
    \end{column}
    \begin{column}{.63\textwidth}
      \vspace*{-4pt}%
      \centering%
      \begin{tikzpicture}[even odd rule, scale=1]
        \coordinate (text) at (0,0);
        \filldraw[fill=blue!25!lightgray, draw=blue!25!lightgray]
        (0,0) rectangle (\textwidth, -.5\textwidth)
        (2pt,-15pt) rectangle (\textwidth-2pt, -.5\textwidth+2pt);
        \node[anchor=north west] at (0pt, 0pt) {Editor: HelloWorld.tex};
        \node[anchor=north west] at (4pt, -12pt) {\parbox[t][.5\textwidth-27pt][t]{\textwidth-12pt}{%
104
            \lstinputlisting[language=tex, basicstyle=\small\ttfamily]{examples/minimal.tex}
105
106
107
108
109
110
111
112
113
114
        }};
      \end{tikzpicture}\\[-11pt]
      \includegraphics[angle=-90, width=.1\textwidth]{figures/texstudio-compile.pdf}\\[2pt]
      \begin{tikzpicture}[even odd rule, scale=1]
        \coordinate (text) at (0,0);
        \filldraw[fill=blue!25!lightgray, draw=blue!25!lightgray]
        (0,0) rectangle (\textwidth, -.4\textwidth)
        (2pt,-15pt) rectangle (\textwidth-2pt, -.4\textwidth+2pt);
        \node[anchor=north west] at (0pt, 0pt) {PDF viewer: HelloWorld.pdf};
        \node[anchor=north west] at (2pt, -15pt) {\parbox[t][.4\textwidth-27pt][c]{\textwidth-12pt}{%
Valentin Bruch's avatar
Valentin Bruch committed
115
            \hspace{.1\textwidth}Hallo Welt!
116
117
118
119
120
121
        }};
      \end{tikzpicture}
    \end{column}
  \end{columns}
\end{frame}

Stefan Heimersheim's avatar
Stefan Heimersheim committed
122
123
% Logo einblenden
\OSAKthemelogo
124
125
126
\subsection{Beispieldokument}
\section{Präsentationen mit \LaTeX-Beamer}
\subsection{?}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
127
% Logo ausblenden
128
129
\OSAKthemenologo

Stefan Heimersheim's avatar
Stefan Heimersheim committed
130
\begin{frame}[fragile]{Beispielfolie}{Auf dieser Folie sollte eine super Motivation stehen!}
131
132
133
134
135
136
137
138
139
140
141
\structure{Ein bisschen sinnloser Inhalt:}
\begin{itemize}
  \item Hier kein Satz!
  \item Generell: niemals Sätze!
\end{itemize}
\begin{enumerate}
  \item Bilder sind auch toll
  \item Das Logo da unten kann man mit \verb~\OSAKthemenologo~ ausblenden\dots
\end{enumerate}
\end{frame}

Stefan Heimersheim's avatar
Stefan Heimersheim committed
142
143

\begin{frame}[fragile]{Zeilenumbrüche}
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
  \structure{Neue Zeile:}
  \begin{tikzpicture}
      \node[matrix, column sep=4pt, row sep=6pt] {
        \node{
          \begin{minipage}[t][10mm][c]{.28\textwidth}
            \begin{itemize}
                \item Zeilen im \texttt{.tex} ignoriert
            \end{itemize}
          \end{minipage}
        }; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.3\textwidth}
            \lstinputlisting{examples/2a_umbruch.tex}
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.25\textwidth}
            \input{examples/2a_umbruch.tex}
          \end{minipage}
        };
        \\
        \node{
          \begin{minipage}[t][10mm][c]{.28\textwidth}
            \begin{itemize}
                \item Absatz: Leere Zeile
            \end{itemize}
          \end{minipage}
        }; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.3\textwidth}
            \lstinputlisting{examples/2b_umbruch.tex}
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.25\textwidth}
            \input{examples/2b_umbruch.tex}
          \end{minipage}
        };
        \\
        \node{
          \begin{minipage}[t][10mm][c]{.28\textwidth}
            \begin{itemize}
                \item Manueller Zeilenumbruch
            \end{itemize}
          \end{minipage}
        }; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.3\textwidth}
            \lstinputlisting{examples/2c_umbruch.tex}
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.25\textwidth}
            \input{examples/2c_umbruch.tex}
          \end{minipage}
        };
        \\
      };
    \end{tikzpicture}

  \structure{Neue Seite:}
  \begin{tikzpicture}
      \node[matrix, column sep=4pt, row sep=6pt] {
        \node{
          \begin{minipage}[t][10mm][c]{.28\textwidth}
            \begin{itemize}
                \item Manueller Seitenumbruch
            \end{itemize}
          \end{minipage}
        }; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.3\textwidth}
            \lstinputlisting{examples/2d_umbruch.tex}
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.25\textwidth}
            Foto
          \end{minipage}
        };
        \\
      };
    \end{tikzpicture}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
231

232
233
\end{frame}

234

Stefan Heimersheim's avatar
Stefan Heimersheim committed
235
\begin{frame}[fragile]{Formatierung}
236
\structure{Formatierung:}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
237
%TODO Mehrere von diesen structures? + Title
238
239
\begin{tikzpicture}
\node[matrix, column sep=4pt, row sep=6pt] {
Lennart Klebl's avatar
Lennart Klebl committed
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
  \node{
    \begin{minipage}[t][10mm][c]{.28\textwidth}
    \begin{itemize}
    \item Fontstyle
    \end{itemize}
    \end{minipage}
  }; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][10mm][c]{.3\textwidth}
    \lstinputlisting{examples/2e.tex}
    \end{minipage}
  }; &
  \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][10mm][c]{.25\textwidth}
      \textbf{fett} \textit{kursiv}\\
      \underline{unterstrichen}
    \end{minipage}
  };
  \\
  \node{
    \begin{minipage}[t][10mm][c]{.28\textwidth}
    \begin{itemize}
    \item Schriftgröße
    \end{itemize}
    \end{minipage}
  }; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][20mm][c]{.3\textwidth}
    \lstinputlisting{examples/2f.tex}
    \end{minipage}
  }; &
  \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][20mm][c]{.25\textwidth}
      \tiny tiny
      \small small
      \large large\\
Stefan Heimersheim's avatar
Stefan Heimersheim committed
278
279
      \Large Large\,\LARGE LARGE\\
      ...
Lennart Klebl's avatar
Lennart Klebl committed
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
    \end{minipage}
  };
  \\
  \node{
    \begin{minipage}[t][10mm][c]{.28\textwidth}
    \begin{itemize}
    \item Textfarbe
    \end{itemize}
    \end{minipage}
  }; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][10mm][c]{.3\textwidth}
    \lstinputlisting[basicstyle=\notsotiny\ttfamily]{examples/2g.tex}
    \end{minipage}
  }; &
  \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][10mm][c]{.25\textwidth}
    \input{examples/2g.tex}
    \end{minipage}
  };
  \\
Lennart Klebl's avatar
Lennart Klebl committed
302
303
304
305
306
307
  \node{
  \begin{minipage}[t][10mm][c]{.28\textwidth}
  \begin{itemize}
  \item Überschriften (automatisch)
  \end{itemize}
  \end{minipage}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
308
309
}; &
\node[draw=blue!20!lightgray, line width=2pt]{
Lennart Klebl's avatar
Lennart Klebl committed
310
311
312
  \begin{minipage}[t][10mm][c]{.3\textwidth}
  \lstinputlisting[basicstyle=\notsotiny\ttfamily]{examples/2h.tex}
  \end{minipage}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
313
314
315
}; &
\node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
\node[draw=blue!20!lightgray, line width=2pt]{
Lennart Klebl's avatar
Lennart Klebl committed
316
317
318
  \begin{minipage}[t][10mm][c]{.25\textwidth}
  Foto
  \end{minipage}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
319
320
321
322
323
324
325
326
327
328
329
330
331
332
};
\\
};
\end{tikzpicture}

\end{frame}



\begin{frame}[fragile]{Abschnitte und Umgebungen}
\structure{Umgebungen:}
%TODO Überschriften verbessen
\begin{tikzpicture}
\node[matrix, column sep=4pt, row sep=6pt] {
Lennart Klebl's avatar
Lennart Klebl committed
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
  \node{
    \begin{minipage}[t][10mm][c]{.28\textwidth}
    \begin{itemize}
    \item Center / Linksbündig
    \end{itemize}
    \end{minipage}
  }; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][30mm][c]{.3\textwidth}
    \lstinputlisting{examples/3b.tex}
    \end{minipage}
  }; &
  \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][30mm][c]{.25\textwidth}
        \input{examples/3b.tex}
    \end{minipage}
  };
  \\
  \node{
    \begin{minipage}[t][10mm][c]{.28\textwidth}
    \begin{itemize}
    \item Auflistungen
    \end{itemize}
    \end{minipage}
  }; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][30mm][c]{.3\textwidth}
    \lstinputlisting{examples/3c.tex}
    \end{minipage}
  }; &
  \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
  \node[draw=blue!20!lightgray, line width=2pt]{
    \begin{minipage}[t][30mm][c]{.25\textwidth}
    \input{examples/3c.tex}
    \end{minipage}
  };
  \\
371
372
373
374
375
};
\end{tikzpicture}

\end{frame}

Stefan Heimersheim's avatar
Stefan Heimersheim committed
376

Lennart Klebl's avatar
Lennart Klebl committed
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
\begin{frame}[fragile]{Mathematik}
  \begin{tikzpicture}
      \node[matrix, column sep=4pt, row sep=6pt] {
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            \scriptsize \ttfamily \verb|\vec x^2 = x_1^2 + x_2^2|
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            $\displaystyle \vec x^2 = x_1^2 + x_2^2 $
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.4\textwidth}
            \centering
Lennart Klebl's avatar
Lennart Klebl committed
397
398
            \scriptsize \ttfamily \verb|\sum_{n=0}^\infty n =|
            \verb|-\frac{1}{12}|
Lennart Klebl's avatar
Lennart Klebl committed
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
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.4\textwidth}
            \centering
            $\displaystyle\sum_{n=0}^\infty n = -\frac{1}{12}$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            \scriptsize \ttfamily
            \verb|\nabla\cdot\vec E = 4\pi\rho|
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            $\displaystyle\nabla\cdot\vec E = 4\pi\rho$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            \scriptsize \ttfamily
            \verb|\sqrt{e^{i\pi}} = \pm i|
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            $\displaystyle \sqrt{e^{i\pi}} = \pm i$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.4\textwidth}
            \centering
            \scriptsize \ttfamily
Lennart Klebl's avatar
Lennart Klebl committed
443
            \verb|\sin(30^\circ) =| \verb|\frac{\sqrt{3}}{2}|
Lennart Klebl's avatar
Lennart Klebl committed
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
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][10mm][c]{.4\textwidth}
            \centering
            $\displaystyle \sin(30^\circ) = \frac{\sqrt{3}}{2}$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            \scriptsize \ttfamily
            \verb|m\approx 80\,\mathrm{kg}|
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][7mm][c]{.4\textwidth}
            \centering
            $\displaystyle m\approx 80\,\mathrm{kg}$
          \end{minipage}
        };
        \\
      };
    \end{tikzpicture}
\end{frame}

Lennart Klebl's avatar
Lennart Klebl committed
473
474
475
476
477
478
479
480
481
482
483
484
\begin{frame}{Detexify}
\end{frame}

\begin{frame}{Bilder \& Tabellen}
\end{frame}

\begin{frame}{Referenzen}
\end{frame}

\begin{frame}{Präambel}
\end{frame}

485
\end{document}