latex.tex 28.1 KB
Newer Older
Stefan Heimersheim's avatar
Stefan Heimersheim committed
1
\documentclass[xcolor=dvipsnames]{beamer}
2
3
4
5
6
7
\newif\ifshownotes
\ifdefined\shownotes
  \shownotestrue
\else
  \shownotesfalse
\fi
8

Lennart Klebl's avatar
präsi    
Lennart Klebl committed
9
10
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
11
\usepackage[ngerman]{babel}
Lennart Klebl's avatar
präsi    
Lennart Klebl committed
12
%\usepackage{lmodern}
13
14
\usepackage{verbatim}
\usepackage{dtk-logos}
15
\usepackage{tikz}
Valentin Bruch's avatar
Valentin Bruch committed
16
\usetikzlibrary{backgrounds, fit, matrix, calc}
17
18
\usepackage{listings}
\usepackage{calc}
Lennart Klebl's avatar
qrcode    
Lennart Klebl committed
19
\usepackage{qrcode}
20
\usepackage{mathtools}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
21
\graphicspath{{figures/}{examples/}}
Lennart Klebl's avatar
Lennart Klebl committed
22
\usefonttheme{professionalfonts}
Lennart Klebl's avatar
Lennart Klebl committed
23
\newcommand{\bsl}{\textbackslash}
24

25
26
27
\definecolor{darkgreen}{rgb}{0,0.5,0}
\renewcommand\note[2][]{\ifshownotes#1{\color{darkgreen}#2}\fi}
\newcommand\colorifnote{\ifshownotes\color{darkgreen}\fi}
28

Lennart Klebl's avatar
präsi    
Lennart Klebl committed
29
30
\hypersetup{unicode=true}

Lennart Klebl's avatar
Lennart Klebl committed
31
32
\setmonofont{FiraCode}

33
34
\usetheme{OSAK}

Stefan Heimersheim's avatar
Stefan Heimersheim committed
35
\lstset{
Lennart Klebl's avatar
Lennart Klebl committed
36
37
38
39
40
  basicstyle=\scriptsize\ttfamily,
  language={[LaTeX]TeX},
  texcsstyle=*\color{Mahogany}\bfseries,
  commentstyle=\itshape\color{RoyalBlue},
  keywordstyle=\color{RoyalBlue}\bfseries,
Lennart Klebl's avatar
Lennart Klebl committed
41
  moretexcs={lstset,subsubsection,paragraph,subsection,color,sl,textcolor,lstinputlisting,newfontfamily,fontsize,section,documentclass,begin,includegraphics,hello,bye,setmainlanguage,setlength},
42
43
  morekeywords={center,document,flushleft,flushright,itemize,enumerate,tabular,article,polyglossia,geometry,amsmath,graphicx,xcolor,hyperref,figure,babel,mathtools,equation,align},
  deletetexcs={vec}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
44
45
}

46
47
48
49
\makeatletter
\newcommand\notsotiny{\@setfontsize\notsotiny{7}{8}}
\makeatother

50
\date{5. Juni 2019}
Lennart Klebl's avatar
Lennart Klebl committed
51
52
\title[Einführung in \LaTeX]{Einführung in \LaTeX}
\author{Valentin Bruch}
53
54
55
56
57
58
\institute[OSAK]{
  Open Source Arbeitskreis der \\
  Fachschaft Mathematik/Physik/Informatik an der RWTH Aachen \\
  und der Aachener Linux User Group
}

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
%Copied from
%https://tex.stackexchange.com/questions/198091/get-number-of-pages-of-external-pdf
\newcommand*{\pdfnumberofpages}[1]{%
  \directlua{%
    local doc = epdf.open("\luaescapestring{#1}")
    local pages
    if (doc) then
      pages = doc:getCatalog():getNumPages()
    else
      pages = 0
    end
    tex.write(pages)
  }%
}

\newcommand\insertexample[2][]{%
  {\setbeamercolor{background canvas}{bg=gray!10!white}
  \begin{frame}
    \def\tmp{#1}\ifx\tmp\empty%
      \frametitle{Beispiel}%
    \else%
      \frametitle{Beispiel: #1}%
    \fi%
    \vspace*{-3.8pt}%
    \ifnum\pdfnumberofpages{#2}<2%
      \centering%
      \colorbox{white}{\includegraphics[width=.67\textwidth]{#2}}%
    \else%
      \colorbox{white}{\includegraphics[width=.48\textwidth, page=1]{#2}}%
      \hfill%
      \colorbox{white}{\includegraphics[width=.48\textwidth, page=2]{#2}}%
    \fi%
  \end{frame}
  }
Valentin Bruch's avatar
Valentin Bruch committed
93
94
}

95
\begin{document}
Valentin Bruch's avatar
Valentin Bruch committed
96
\ifshownotes\OSAKthemenologo\fi
97

Valentin Bruch's avatar
Valentin Bruch committed
98
\section{Installation und Motivation}
99
\begin{frame}{OSAK \LaTeX-Workshop}{Installation einer \TeX-Distribution}
Valentin Bruch's avatar
Valentin Bruch committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  \ifshownotes{\large%
    \begin{itemize}
      \item Was studiert ihr? Welche Semester?
      \item \TeX{} für: Alles mit Formeln oder schöner Formatierung,
        z.\,B. Abschlussarbeiten
      \item Wer hat \TeX{} schon installiert?
        \begin{itemize}
          \item Inkl. \TeX-Studio?
          \item Welches \TeX? (MiK\TeX, Mac\TeX, \TeX{}Live, \ldots)
        \end{itemize}
      \item Überblick:
        \begin{itemize}
          \item Installation
          \item Workshop mit Beispiel
          \item Einführung in Beamer
        \end{itemize}
    \end{itemize}
  }%
  \else%
Lennart Klebl's avatar
qrcode    
Lennart Klebl committed
119
120
121
122
123
124
  {
  \begin{center}
    \scalebox{2.0}{\qrcode{https://fsmpi.eu/latex}} \\[10pt]
      \url{https://fsmpi.eu/latex}
  \end{center}
  }
Valentin Bruch's avatar
Valentin Bruch committed
125
  \fi%
126
127
128
129
130
131
132
\end{frame}

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

\section{Dokumente mit \LaTeX}
133
134
\subsection{Aufbau eines \LaTeX-Dokuments}
\OSAKthemenologo
Lennart Klebl's avatar
Lennart Klebl committed
135
\begin{frame}[fragile]{Aufbau eines \LaTeX-Dokuments}
136
  \begin{columns}[T]
Lennart Klebl's avatar
Lennart Klebl committed
137
138
    \begin{column}{.45\textwidth}
      \structure{{\LaTeX} übersetzt Text in ein PDF} \\[12pt]
139
      \begin{itemize}
140
        \note[\item]{Wer hat schon mal ein Dokument erstellt?\\[10pt]}
Lennart Klebl's avatar
Lennart Klebl committed
141
142
143
144
        \item Automatische Formatierung \\[12pt]
        \item Befehle, z.\,B. \texttt{\textbackslash textbf\{\}}, haben Effekte 
          (z.\,B. \textbf{fett}) \\[12pt]
        \item Kommentare (mit \%) werden ignoriert \\[12pt]
145
146
      \end{itemize}
    \end{column}
Lennart Klebl's avatar
Lennart Klebl committed
147
    \begin{column}{.5\textwidth}
148
149
150
151
152
153
154
155
156
      \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}{%
Lennart Klebl's avatar
Lennart Klebl committed
157
            \lstinputlisting[basicstyle=\scriptsize\ttfamily]{examples/minimal.tex}
158
159
160
161
162
163
164
165
166
167
        }};
      \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}{%
Lennart Klebl's avatar
Lennart Klebl committed
168
          \hspace{.1\textwidth}$\mathrm{Hallo\ Welt!}$
169
170
171
172
173
174
        }};
      \end{tikzpicture}
    \end{column}
  \end{columns}
\end{frame}

175
\subsection{\TeX{}studio als Editor}
176
177
\begin{frame}{\TeX{}Studio (Editor)}
  \vspace{-3.8pt}%
Lennart Klebl's avatar
Lennart Klebl committed
178
179
  \includegraphics[width=\textwidth]{figures/texstudio.png}
\end{frame}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
180

Valentin Bruch's avatar
Valentin Bruch committed
181
\subsection{Absatzformatierung}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
182
183
\begin{frame}[fragile]{Umbrüche}
  \structure{Zeilen:}
184
  \vskip-\baselineskip%
185
  \begin{tikzpicture}
186
    \node[matrix, column sep=4pt, row sep=6pt] {
187
188
      & \node[anchor=base]{\texttt{dokument.tex}}; &
      & \node[anchor=base]{\texttt{dokument.pdf}}; \\
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
      \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 Leere Zeile\\$\implies$ Absatz
          \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 Zeilenumbruch manuell: \texttt{\textbackslash\textbackslash}
          \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}
244
      };
245
246
247
      \\
    };
  \end{tikzpicture}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
248
  \structure{Seiten:}
249
  \begin{tikzpicture}
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
    \node[matrix, column sep=4pt, row sep=6pt] {
      \node{
        \begin{minipage}[t][10mm][c]{.28\textwidth}
          \begin{itemize}
              \item Manuell neue Seite:
          \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}
          \includegraphics[width=\textwidth]{figures/newpage.png}
        \end{minipage}
268
      };
269
270
271
      \\
    };
  \end{tikzpicture}
272
273
\end{frame}

274
275
\insertexample[Nur Text]{beispieldokument/zeta_0.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
276
\subsection{Textformatierung}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
277
\begin{frame}[fragile]{Formatierung}
278
279
280
281
  \structure{Schrifteinstellungen:}
  \vskip-\baselineskip%
  \begin{tikzpicture}
    \node[matrix, column sep=4pt, row sep=6pt] {
282
283
      & \node[anchor=base]{\texttt{dokument.tex}}; &
      & \node[anchor=base]{\texttt{dokument.pdf}}; \\
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
      \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}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
307
308
        \item Schriftgröße\\\small\textit{Tipp:}
        \texttt{\textbackslash normalsize} setzt Schriftgröße auf normal
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
        \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\\
          \Large Large\,\LARGE LARGE\\
          ...
        \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
347
  };
348
  \end{tikzpicture}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
349
350
\end{frame}

351
352
\insertexample[Textformatierung]{beispieldokument/zeta_1.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
353
\subsection{Abschnitte}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
354
\begin{frame}[fragile]{Abschnitte}
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
  \begin{columns}
    \begin{column}{0.48\textwidth}
      \structure{section, subsection, subsubsection:}
      \begin{itemize}
        \item Überschriften\\(automatisch nummeriert)\\[2pt]
          \begin{tikzpicture}
            \node[draw=blue!20!lightgray, line width=2pt]{
              \begin{minipage}[t][22mm][c]{0.7\textwidth}
              \lstinputlisting[basicstyle=\notsotiny\ttfamily]{examples/2h.tex}
              \end{minipage}
            };
          \end{tikzpicture}
        \item Inhaltsverzeichnis\\(automatisch erstellt)\\[2pt]
          \texttt{\textbackslash tableofcontents}
      \end{itemize}
      \vspace*{24pt}
    \end{column}
    \begin{column}{0.5\textwidth}
        \includegraphics[width=\textwidth,trim=0cm 0cm 0cm 0cm, clip]{examples/2h_fake.pdf}
    \end{column}
  \end{columns}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
376
377
\end{frame}

378
379
\insertexample[Abschnitte]{beispieldokument/zeta_2.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
380
\subsection{Umgebungen}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
381
\begin{frame}[fragile]{Umgebungen}
Valentin Bruch's avatar
Valentin Bruch committed
382
383
384
385
386
387
388
389
  \vspace*{-4pt}
  \begin{center}
    {\color{darkred!80!gray}Umgebungen:} durch
    \texttt{{\color{Mahogany}\bfseries\textbackslash begin}\{\ldots\}} und
    \texttt{{\color{Mahogany}\bfseries\textbackslash end}\{\ldots\}} begrenzt
  \end{center}
  \vspace*{-2pt}
  \hspace*{-4pt}\begin{tikzpicture}
Valentin Bruch's avatar
Valentin Bruch committed
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
  \node[matrix, column sep=4pt, row sep=6pt] {
    \node{
      \begin{minipage}[t][10mm][c]{.28\textwidth}
      \structure{Textausrichting:}
      \begin{itemize}
      \item Mittig / Linksbündig / Rechtsbündig
      \end{itemize}
      \end{minipage}
    }; &
    \node[draw=blue!20!lightgray, line width=2pt]{
      \begin{minipage}[t][34mm][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][34mm][c]{.25\textwidth}
          \input{examples/3b.tex}
      \end{minipage}
    };
    \\
    \node{
      \begin{minipage}[t][10mm][c]{.28\textwidth}
      \structure{Listen:}
      \begin{itemize}
      \item Stichpunkte / Aufzählungen
      \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}
    };
    \\
Lennart Klebl's avatar
Lennart Klebl committed
431
  };
Valentin Bruch's avatar
Valentin Bruch committed
432
  \end{tikzpicture}
433
434
\end{frame}

435
436
\insertexample[Umgebungen]{beispieldokument/zeta_3.pdf}

Lennart Klebl's avatar
Lennart Klebl committed
437
438
\newcommand{\highlightRed}[1]{{\color{Mahogany}\texttt{\bfseries #1}}}
\newcommand{\highlightBlu}[1]{{\color{RoyalBlue}\texttt{\bfseries #1}}}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
439

Valentin Bruch's avatar
Valentin Bruch committed
440
\section{Mathematik}
Lennart Klebl's avatar
Lennart Klebl committed
441
\begin{frame}[fragile]{Mathematik}
442
  \structure{Umgebungen:}
Lennart Klebl's avatar
Lennart Klebl committed
443
  \begin{itemize}
444
445
446
447
448
    \item \highlightBlu{equation}{\bfseries:} Vom Text abgesetzte Gleichung
      \\[4pt]
      \begin{tikzpicture}
        \node[matrix, column sep=4pt, row sep=4pt] {
          \node[draw=blue!20!lightgray,line width=2pt]{
Valentin Bruch's avatar
Valentin Bruch committed
449
            \begin{minipage}[t][11mm][c]{.33\textwidth}
450
451
452
              \lstinputlisting{examples/equation.tex}
            \end{minipage}
          };&
453
          \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}};&
454
          \node[draw=blue!20!lightgray,line width=2pt]{
Valentin Bruch's avatar
Valentin Bruch committed
455
            \begin{minipage}[t][11mm][c]{.33\textwidth}
456
457
458
459
460
461
462
463
              \vspace*{-2pt}
              \input{examples/equation}
            \end{minipage}
          };\\
        };
      \end{tikzpicture}\\[8pt]
    \item \highlightBlu{align}{\bfseries:} Wie \highlightBlu{equation}, nur 
      dass man an \highlightRed{\&} ausrichten kann\\[10pt]
464
465
466
    \item Wie bei z.\,B.  \highlightRed{\textbackslash section*\{...\}} auch:\\
      \highlightBlu{*} für nicht-nummerierte Gleichungen, also
      \highlightRed{\textbackslash begin\{}%
467
468
      \highlightBlu{align*}\highlightRed{\}}
      \\[10pt]
Lennart Klebl's avatar
Lennart Klebl committed
469
  \end{itemize}
470
  \structure{Im Textfluss} kann man Gleichungen mit \highlightRed{\$...\$}
Lennart Klebl's avatar
Lennart Klebl committed
471
472
473
474
475
  schreiben, also z.\,B.
  \begin{center}
    \begin{tikzpicture}
      \node[matrix, column sep=4pt, row sep=6pt] {
      \node[draw=blue!20!lightgray,line width=2pt]{
476
        \begin{minipage}[t][6mm][c]{.45\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
477
478
479
          \texttt{Gleichung: \highlightRed{\$x\^\ 2 = 25\$}}
        \end{minipage}
      };&
480
      \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}};&
Lennart Klebl's avatar
Lennart Klebl committed
481
      \node[draw=blue!20!lightgray,line width=2pt]{
482
        \begin{minipage}[t][6mm][c]{.3\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
483
484
485
486
487
488
          \textrm{Gleichung: $x^2 = 25$}
        \end{minipage}
      };\\
    };
    \end{tikzpicture}
  \end{center}
Lennart Klebl's avatar
Lennart Klebl committed
489
490
491
\end{frame}

\begin{frame}[fragile]{Mathematik -- Beispiele}
Lennart Klebl's avatar
Lennart Klebl committed
492
  \begin{tikzpicture}
493
494
      \node[matrix, column sep=4pt, row sep=4pt] {
        \node[draw=blue!20!lightgray,line width=2pt]{
495
          \begin{minipage}[t][14.5mm][c]{.42\textwidth}
496
497
            \vspace{1pt}
            \lstinputlisting{examples/align.tex}
Lennart Klebl's avatar
Lennart Klebl committed
498
          \end{minipage}
499
        };&
500
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}};&
501
502
503
504
505
        \node[draw=blue!20!lightgray,line width=2pt]{
          \begin{minipage}[t][14.5mm][c]{.4\textwidth}
            \null\hfill$\displaystyle%
            \vec{x}=\mathrlap{\|\vec{x}\|^2}\hphantom{x_1^2+x_2^2}\hfill\mathllap{(1)}$\\[2pt]
            \null\hfill$\displaystyle\hphantom{\vec{x}}=x_1^2+x_2^2{}\hfill\mathllap{(2)}$\\[-6pt]
Lennart Klebl's avatar
Lennart Klebl committed
506
          \end{minipage}
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
        };\\
        %\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}
        %};
        %\\
Lennart Klebl's avatar
Lennart Klebl committed
522
        \node[draw=blue!20!lightgray, line width=2pt]{
523
          \begin{minipage}[t][10mm][c]{.42\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
524
            \centering
525
            \scriptsize\ttfamily \verb|\sum_{n=0}^\infty n =|
526
            \colorifnote\verb|-\frac{1}{12}|
Lennart Klebl's avatar
Lennart Klebl committed
527
528
529
530
531
532
          \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
533
534
            $\displaystyle\sum_{n=0}^\infty n =
            -\colorifnote\frac{1}{12}$
Lennart Klebl's avatar
Lennart Klebl committed
535
536
537
538
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
539
          \begin{minipage}[t][6mm][c]{.42\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
540
            \centering
541
            \scriptsize\ttfamily
542
            \verb|\nabla\cdot\vec{E} = 4|\colorifnote\verb|\pi\rho|
Lennart Klebl's avatar
Lennart Klebl committed
543
544
545
546
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
547
          \begin{minipage}[t][6mm][c]{.4\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
548
549
550
551
552
553
            \centering
            $\displaystyle\nabla\cdot\vec E = 4\pi\rho$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
554
          \begin{minipage}[t][6mm][c]{.42\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
555
            \centering
556
557
            \scriptsize\ttfamily
            {\colorifnote\verb|\sqrt|}\verb|{e^{i\pi}} = \pm i|
Lennart Klebl's avatar
Lennart Klebl committed
558
559
560
561
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
562
          \begin{minipage}[t][6mm][c]{.4\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
563
564
565
566
567
568
            \centering
            $\displaystyle \sqrt{e^{i\pi}} = \pm i$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
569
          \begin{minipage}[t][9mm][c]{.42\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
570
            \centering
571
            \scriptsize\ttfamily
Lennart Klebl's avatar
Lennart Klebl committed
572
            \verb|\sin(30^\circ) =| \verb|\frac{\sqrt{3}}{2}|
Lennart Klebl's avatar
Lennart Klebl committed
573
574
575
576
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
577
          \begin{minipage}[t][9mm][c]{.4\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
578
579
580
581
582
583
            \centering
            $\displaystyle \sin(30^\circ) = \frac{\sqrt{3}}{2}$
          \end{minipage}
        };
        \\
        \node[draw=blue!20!lightgray, line width=2pt]{
584
          \begin{minipage}[t][6mm][c]{.42\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
585
            \centering
586
            \scriptsize\ttfamily
Lennart Klebl's avatar
Lennart Klebl committed
587
588
589
590
591
            \verb|m\approx 80\,\mathrm{kg}|
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
592
          \begin{minipage}[t][6mm][c]{.4\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
593
594
595
596
597
598
599
600
601
            \centering
            $\displaystyle m\approx 80\,\mathrm{kg}$
          \end{minipage}
        };
        \\
      };
    \end{tikzpicture}
\end{frame}

Lennart Klebl's avatar
Lennart Klebl committed
602
603
\begin{frame}{Detexify}{\url{http://detexify.kirelabs.org}}
  \vspace{-18pt}
Lennart Klebl's avatar
Lennart Klebl committed
604
  \includegraphics[width=\textwidth]{figures/detexify.png}
605
  \note[\centering]{\large auf \texttt{\textbackslash usepackage} achten!}%
Lennart Klebl's avatar
Lennart Klebl committed
606
607
\end{frame}

608
609
\insertexample[Mathematik]{beispieldokument/zeta_4.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
610
\section{Bilder und Tabellen}
Lennart Klebl's avatar
Lennart Klebl committed
611
\begin{frame}[fragile]{Bilder \& Tabellen}
Lennart Klebl's avatar
Lennart Klebl committed
612
613
  \begin{itemize}
    \item \highlightRed{\textbackslash%
614
      includegraphics}\texttt{[optional]}\highlightRed{\{...\}}, um Bilder
Lennart Klebl's avatar
Lennart Klebl committed
615
      einzubinden (bspw. \texttt{width=0.9\textbackslash textwidth} als Option)
Lennart Klebl's avatar
Lennart Klebl committed
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
    \begin{tikzpicture}
      \node[matrix,column sep=4pt, row sep=6pt] {
        \node[draw=blue!20!lightgray,line width=2pt]{
          \begin{minipage}[t][1.0cm][c]{.4\textwidth}
            \lstinputlisting[basicstyle=\tiny]{examples/includegraphics.tex}
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray,line width=2pt]{
          \begin{minipage}[t][1.0cm][c]{.3\textwidth}
            \centering
            \includegraphics[width=1.0cm]{figures/doge.png}
          \end{minipage}
        }; \\
      };
Lennart Klebl's avatar
Lennart Klebl committed
631
    \end{tikzpicture} \\[12pt]
Lennart Klebl's avatar
Lennart Klebl committed
632
    \item \highlightBlu{tabular}-Umgebung für Tabellen:
Lennart Klebl's avatar
Lennart Klebl committed
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
    \begin{tikzpicture}
      \node[matrix, column sep=4pt, row sep=6pt] {
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][1.8cm][c]{.4\textwidth}
            \lstinputlisting[basicstyle=\tiny]{examples/tabular.tex}
          \end{minipage}
        }; &
        \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
        \node[draw=blue!20!lightgray, line width=2pt]{
          \begin{minipage}[t][1.8cm][c]{.3\textwidth}
            \includegraphics[width=\textwidth]{examples/tabular.pdf}
          \end{minipage}
        }; \\
      };
    \end{tikzpicture}
Lennart Klebl's avatar
Lennart Klebl committed
648
  \end{itemize}
Lennart Klebl's avatar
Lennart Klebl committed
649
650
\end{frame}

651
652
\insertexample[Bilder]{beispieldokument/zeta_5.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
653
\subsection{Floats}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
654
\begin{frame}[fragile]{Abbildungen mit \glqq{}Floats\grqq{}}
655
656
  \begin{columns}
    \begin{column}{0.45\textwidth}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
657
658
      \highlightBlu{figure} \& \highlightBlu{table} \emph{Umgebungen} für
      Bilder und Tabellen:\vspace{14pt}
659
660
      \begin{itemize}
          \small
Stefan Heimersheim's avatar
Stefan Heimersheim committed
661
662
663
        \item Mit \highlightRed{\textbackslash{}includegraphics} bzw.
        \highlightBlu{tabular} für Inhalt
          \scriptsize\\
664
665
666
667
          (\emph{{\ttfamily\color{RoyalBlue}table} \&
          {\ttfamily\color{RoyalBlue}figure} sind initial leer!})
          \normalsize
          \\[12pt]
Stefan Heimersheim's avatar
Stefan Heimersheim committed
668
669
670
        \item \highlightRed{\textbackslash{}centering} für zentrierten Inhalt \\[12pt]
        \item \highlightRed{\textbackslash{}caption}\verb+{Text}+ für Beschriftung und Verweise\\[12pt]

671
672
673
674
675
676
677
678
679
680
        % TODO Bild von float machen!
      \end{itemize}
    \end{column}
    \begin{column}{0.45\textwidth}
      \begin{tikzpicture}
        \node[matrix,column sep=4pt, row sep=6pt] {
          \node[draw=blue!20!lightgray,line width=2pt]{
            \begin{minipage}[t][2.1cm][c]{\textwidth}
              \lstinputlisting[basicstyle=\tiny]{examples/figure.tex}
            \end{minipage}
Lennart Klebl's avatar
Lennart Klebl committed
681
          }; \\[-4pt]
682
683
          \node[rotate=270]{
            \includegraphics[width=16pt]{figures/texstudio-compile.pdf}
Lennart Klebl's avatar
Lennart Klebl committed
684
          }; \\[-4pt]
685
686
687
688
689
690
691
692
693
694
          \node[draw=blue!20!lightgray,line width=2pt]{
            \begin{minipage}[t][2.75cm][c]{\textwidth}
              \centering
              \includegraphics[width=0.7\textwidth]{examples/figure.pdf}
            \end{minipage}
          }; \\
        };
      \end{tikzpicture}
    \end{column}
  \end{columns}
Lennart Klebl's avatar
floats    
Lennart Klebl committed
695
696
\end{frame}

697
698
\insertexample[Floats]{beispieldokument/zeta_6.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
699
\section{Labels und Referenzen}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
700
\begin{frame}[fragile]{Labels, Referenzen und Links}
Lennart Klebl's avatar
Lennart Klebl committed
701
702
  \structure{Referenzen} markieren mit 
  \texttt{\bfseries\color{Mahogany}\textbackslash label},
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
  verweisen mit \texttt{\bfseries\color{Mahogany}\textbackslash ref}:\\[2pt]
  \hspace*{-6pt}\begin{tikzpicture}
    \node[matrix, column sep=3pt, row sep=8pt] {
      \node{
        \begin{minipage}[t][10mm][c]{.28\textwidth}
          \begin{itemize}
            \item Gleichungen, Sections, Figures und vieles mehr!
          \end{itemize}
        \end{minipage}
      }; &
      \node[draw=blue!20!lightgray, line width=2pt]{
        \begin{minipage}[t][26mm][c]{.3\textwidth}
          \lstinputlisting{examples/4a.tex}
        \end{minipage}
      }; &
      \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
      \node[draw=blue!20!lightgray, line width=2pt]{
        \begin{minipage}[t][26mm][c]{.25\textwidth}
          \input{examples/4a.tex}
        \end{minipage}
      };
      \\
      \node{
        \begin{minipage}[t][10mm][c]{.28\textwidth}
          \begin{itemize}
728
            \item \highlightRed{\bsl ref} darf auch vor dem
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
              \highlightRed{\bsl label} stehen
          \end{itemize}
        \end{minipage}
      }; &
      \node[draw=blue!20!lightgray, line width=2pt]{
        \begin{minipage}[t][26mm][c]{.3\textwidth}
          \lstinputlisting{examples/4b.tex}
        \end{minipage}
      }; &
      \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
      \node[draw=blue!20!lightgray, line width=2pt]{
        \begin{minipage}[t][26mm][c]{.25\textwidth}
              \includegraphics[width=\textwidth,trim=0cm 0cm 0cm 0cm, clip]{examples/4b_fake.png}
        \end{minipage}
      };
      \\
    };
  \end{tikzpicture}
Lennart Klebl's avatar
Lennart Klebl committed
747
748
\end{frame}

749
750
\insertexample[Referenzen]{beispieldokument/zeta_7.pdf}

751
752
\begin{frame}[fragile]{Verschiedenes}
  \structure{Fußnoten:}
Lennart Klebl's avatar
Lennart Klebl committed
753
  \begin{itemize}
Lennart Klebl's avatar
Lennart Klebl committed
754
755
    \item Einfügen mit \highlightRed{\bsl footnote}\verb+{Fußnotentext}+
      irgendwo:
Lennart Klebl's avatar
Lennart Klebl committed
756
  \end{itemize}
757
  \begin{center}
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
    \vspace{-8pt}
    \begin{tikzpicture}
    \node[matrix, column sep=4pt, row sep=0pt] {
      \node[draw=blue!20!lightgray, line width=2pt]{
        \begin{minipage}[t][24mm][c]{.5\textwidth}
        \lstinputlisting{examples/4c.tex}
        \end{minipage}
      }; &
      \node{\includegraphics[width=16pt]{figures/texstudio-compile.pdf}}; &
      \node[draw=blue!20!lightgray, line width=2pt]{
        \begin{minipage}[t][24mm][c]{.3\textwidth}
        \includegraphics[width=1\textwidth,trim=0cm 0cm 0cm 0cm, clip]{examples/4c_fake.png}
        \end{minipage}
      };
      \\
Lennart Klebl's avatar
Lennart Klebl committed
773
    };
774
775
    \end{tikzpicture}
    \vspace{-8pt}
776
  \end{center}
777
778
  \structure{URLs:}
  \highlightRed{\textbackslash url}\verb+{http://fsmpi.eu/latex}+ \\[2pt]
779
780
  \structure{Besondere Zeichen}
  \begin{itemize}
781
782
783
784
785
786
787
    \item {\bfseries\color{MidnightBlue}\%, "{}}: \texttt{\textbackslash\%}, \verb+"{}+
    \item {\bfseries\color{MidnightBlue}\&, \#, \$}: \texttt{\textbackslash\&, 
      \textbackslash\#, \textbackslash\$}
    \item {\bfseries\color{MidnightBlue}\textbackslash, \{, \}}: \texttt{\textbackslash 
      textbackslash, \textbackslash\{, \textbackslash\}}
    \item {\bfseries\color{MidnightBlue}\^~, \_, \textasciitilde}: %
      \verb|\^, \_, \textasciitilde|
Lennart Klebl's avatar
präsi    
Lennart Klebl committed
788
      %todo besser sortieren, noch was vergessen?
789
  \end{itemize}
Stefan Heimersheim's avatar
Stefan Heimersheim committed
790
791
\end{frame}

792
793
\insertexample[Fußnoten]{beispieldokument/zeta_8.pdf}

Valentin Bruch's avatar
Valentin Bruch committed
794
\section{Präambel}
Lennart Klebl's avatar
Lennart Klebl committed
795
796
\begin{frame}[fragile]{Präambel}
  \begin{columns}
797
    \begin{column}{0.45\textwidth}
Lennart Klebl's avatar
Lennart Klebl committed
798
      \structure{Die \glqq{Präambel}\grqq} wird benutzt für \\[3pt]
Lennart Klebl's avatar
Lennart Klebl committed
799
      \begin{itemize}
Lennart Klebl's avatar
Lennart Klebl committed
800
801
802
803
804
805
        \item Dokumententyp: \\
          \highlightRed{\textbackslash{}documentclass} \\[4pt]
        \item Pakete laden: \\
          \highlightRed{\textbackslash{}usepackage} \\[4pt]
        \item Macros definieren: \\
          \highlightRed{\textbackslash{}newcommand} \\[4pt]
Lennart Klebl's avatar
Lennart Klebl committed
806
        \item \highlightRed{\textbackslash{}begin}\verb+{document}+ \\
807
          \hspace{1em}Inhalt\\
Lennart Klebl's avatar
Lennart Klebl committed
808
          \highlightRed{\textbackslash{}end}\verb+{document}+
Lennart Klebl's avatar
Lennart Klebl committed
809
      \end{itemize}
810
      \vspace{12pt}
Lennart Klebl's avatar
Lennart Klebl committed
811
    \end{column}
Lennart Klebl's avatar
Lennart Klebl committed
812
    \hspace{10pt}
Lennart Klebl's avatar
Lennart Klebl committed
813
    \begin{column}{0.05\textwidth}
Lennart Klebl's avatar
präsi    
Lennart Klebl committed
814
      {\only<1>{\color{RoyalBlue}}\only<2>{\color{Green}}\rule{0.5pt}{0.8\textheight}}
Lennart Klebl's avatar
Lennart Klebl committed
815
    \end{column}
816
817
    \begin{column}{0.45\textwidth}
      \vspace*{-20pt}
Lennart Klebl's avatar
Lennart Klebl committed
818
      \only<1>{\lstinputlisting[basicstyle=\tiny\ttfamily]{examples/preamble.tex}}
819
      \only<2>{\includegraphics[width=\textwidth]{examples/preamble.pdf}\vspace{-10pt}}
Lennart Klebl's avatar
Lennart Klebl committed
820
    \end{column}
Lennart Klebl's avatar
Lennart Klebl committed
821
    \hspace{-10pt}
Lennart Klebl's avatar
Lennart Klebl committed
822
  \end{columns}
Lennart Klebl's avatar
Lennart Klebl committed
823
824
\end{frame}

825
\end{document}
Lennart Klebl's avatar
Lennart Klebl committed
826
827

\begin{comment}
828
vim:ts=2:spelllang=de:fo=want:expandtab
Lennart Klebl's avatar
Lennart Klebl committed
829
\end{comment}