\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage[scale=2]{ccicons}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\usepackage{xspace}
\usepackage{minted}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.geometric,arrows.meta,backgrounds}
\usepackage{tcolorbox}
\usepackage{qrcode}
\usepackage{amsmath}
\usepackage[style=numeric]{biblatex}
\addbibresource{demo.bib}

% Use the local IBM Plex Sans font files
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage{lmodern}
\else
  \usepackage{fontspec}
  \setmainfont{IBM Plex Sans}[
    Path=./fonts/IBM_Plex_Sans/,
    Extension=.ttf,
    UprightFont={IBMPlexSans-VariableFont_wdth,wght},
    ItalicFont={IBMPlexSans-Italic-VariableFont_wdth,wght},
    BoldFont={IBMPlexSans-Bold},
    BoldFeatures={Path=./fonts/IBM_Plex_Sans/static/},
    BoldItalicFont={IBMPlexSans-BoldItalic},
    BoldItalicFeatures={Path=./fonts/IBM_Plex_Sans/static/},
  ]
  \setsansfont{IBM Plex Sans}[
    Path=./fonts/IBM_Plex_Sans/,
    Extension=.ttf,
    UprightFont={IBMPlexSans-VariableFont_wdth,wght},
    ItalicFont={IBMPlexSans-Italic-VariableFont_wdth,wght},
    BoldFont={IBMPlexSans-Bold},
    BoldFeatures={Path=./fonts/IBM_Plex_Sans/static/},
    BoldItalicFont={IBMPlexSans-BoldItalic},
    BoldItalicFeatures={Path=./fonts/IBM_Plex_Sans/static/},
  ]
\fi

\setminted{
    linenos=true,
    breaklines=true,
    bgcolor=bg,
    fontsize=\footnotesize,
    frame=single,
    rulecolor=\color{palette1},
    numbers=left,
    numbersep=6pt,
    escapeinside=||
}

\newminted{latex}{fontsize=\scriptsize}
\newminted{html}{fontsize=\scriptsize}
\newminted{markdown}{fontsize=\scriptsize}

% Requested palette
\definecolor{palette1}{HTML}{544b9a}
\definecolor{palette2}{HTML}{8f70af}
\definecolor{palette3}{HTML}{f0889e}
\definecolor{palette4}{HTML}{12b3b2}
\definecolor{palette5}{HTML}{7ec291}

\colorlet{accentPink}{palette3}
\colorlet{accentPinkDark}{palette3!65!black}
\colorlet{accentCyan}{palette4}

\definecolor{bg}{HTML}{f7f4ff}

\definecolor{mintedkeyword}{HTML}{544b9a}
\definecolor{mintedstring}{HTML}{12b3b2}
\definecolor{mintedcomment}{HTML}{8f70af}
\definecolor{mintednumber}{HTML}{f0889e}
\definecolor{mintedbg}{HTML}{f7f4ff}

\renewcommand{\theFancyVerbLine}{\textcolor{palette2}{\scriptsize\arabic{FancyVerbLine}}}

% Palette-based colors for Pro & Contra
\definecolor{progreen}{HTML}{7ec291}
\definecolor{conred}{HTML}{f0889e}


\setbeamercolor{structure}{fg=palette1}
\setbeamercolor{titlelike}{fg=palette1}
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{alerted text}{fg=accentPinkDark}
\setbeamercolor{background canvas}{bg=white}
\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{palette primary}{fg=white,bg=palette1}
\setbeamercolor{palette secondary}{fg=white,bg=palette2}
\setbeamercolor{palette tertiary}{fg=white,bg=palette4}
\setbeamercolor{palette quaternary}{fg=white,bg=palette5}
\setbeamercolor{block title}{fg=white,bg=accentCyan}
\setbeamercolor{block body}{bg=accentCyan!15}
\setbeamercolor{block title alerted}{fg=white,bg=accentPink}
\setbeamercolor{block body alerted}{bg=accentPink!12}
\setbeamercolor{block title example}{fg=white,bg=accentCyan}
\setbeamercolor{block body example}{bg=accentCyan!15}

% Umgebungen für Pro & Contra
\newtcolorbox{probox}[1][Vorteile]{
    colback=progreen!15,
    colframe=progreen,
    title=\textbf{#1}
}

\newtcolorbox{contrabox}[1][Herausforderungen]{
    colback=conred!15,
    colframe=conred,
    title=\textbf{#1}
}

\newcommand{\resultboxlabel}{Ergebnis}
\newenvironment{resultbox}[1][Ergebnis]{%
  \renewcommand{\resultboxlabel}{#1}%
  \begin{tcolorbox}[
    colback=white,
    colframe=palette5,
    boxrule=0.4pt,
    arc=0pt,
    sharp corners,
    left=2mm,
    right=2mm,
    top=2mm,
    bottom=2mm,
  ]%
}{%
  \end{tcolorbox}%
  \par\vspace{-1mm}%
  \hfill{\scriptsize\color{palette5}\resultboxlabel}%
  \par\vspace{1mm}%
}

\title{LaTeX Einführungsworkshop}
\subtitle{Von 1977 bis heute -- Professionelles Textsatzsystem}
\author{Ludwig Lorenz. Präsentation erstellt mit Beamer \& Metropolis}
\date{\today}

\begin{document}

\maketitle

\begin{frame}[standout]
\begin{columns}[c,onlytextwidth]
\begin{column}{0.38\textwidth}
\centering
\includegraphics[width=0.85\textwidth]{img/by-sa.png}
\end{column}
\begin{column}{0.58\textwidth}
\raggedright
\Large\bfseries Public Domain Presentation

\vspace{1em}
\normalsize
This presentation can be freely used and shared alike, with contribution to the original source.
\end{column}
\end{columns}
\end{frame}

\metroset{titleformat frame=smallcaps}
\metroset{block=fill}
% block=fill resets block colors; re-apply palette accents
\setbeamercolor{block title}{fg=white,bg=accentCyan}
\setbeamercolor{block body}{bg=accentCyan!15}
\setbeamercolor{block title alerted}{fg=white,bg=accentPink}
\setbeamercolor{block body alerted}{bg=accentPink!12}
\setbeamercolor{block title example}{fg=white,bg=accentCyan}
\setbeamercolor{block body example}{bg=accentCyan!15}

\begin{frame}{Table of contents}
  \setbeamertemplate{section in toc}[sections numbered]
  \tableofcontents
\end{frame}

\section[1977]{Das Jahr 1977}

\begin{frame}[fragile]{Das Jahr 1977}
\begin{figure}
    \centering
    \begin{tikzpicture}
        \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.3\textwidth]{img/starwars1977.jpg}};
        \node[anchor=south west,inner sep=0] at (4,0) {\includegraphics[width=0.3\textwidth]{img/appleii.jpg}};
        \node[anchor=south west,inner sep=0] at (8,0) {\includegraphics[width=0.3\textwidth]{img/guillotine.jpg}};
    \end{tikzpicture}
\end{figure}

\vspace{1em}
\begin{itemize}
    \item Star Wars Premiere
    \item Apple II erscheint
    \item Letzte reguläre Dampflok-Fahrt in Deutschland
\end{itemize}

\end{frame}

\section[Geschichte]{Die Entwicklung von LaTeX}

\begin{frame}{Vom WYSIWYG zum professionellen Textsatz}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
    \centering
    \textbf{Tabelleneditor (1980er)}
    \includegraphics[width=\textwidth]{img/wysiwyg_editor.png}
    \begin{block}{WYSIWYG = What You See Is What You Get}
WYSIWYG Editoren bearbeiten das Dokument in seiner visuell finalen Form.
\end{block}
    
    \small Pixel schubsen in zwei Farben
\end{column}
\begin{column}{0.48\textwidth}
    \centering
    \textbf{Akademische Paper (1980er)}
    \includegraphics[width=\textwidth]{img/journal_paper.png}
    
    \small Professioneller Textsatz
\end{column}
\end{columns}

\end{frame}

\begin{frame}{Zeitleiste: 49 Jahre LaTeX}
\resizebox{\textwidth}{!}{%
\begin{tikzpicture}[
    node distance=0.5cm,
    every node/.style={font=\small},
    timeline/.style={->,thick,>=Stealth}
]
    \draw[timeline] (0,0) -- (12,0);
    
    \foreach \x/\year in {0/1977,3/1984,8/2004,11/2011} {
        \draw[thick] (\x,0.1) -- (\x,-0.1);
        \node[above] at (\x,0.2) {\textbf{\year}};
    }
    
    \node[below,text width=2.5cm,align=center] at (0,-0.3) {Donald Knuth\\startet TeX\\(13 Jahre vor HTML!)};
    
    \pause
    \node[below,text width=2.5cm,align=center] at (3,-0.3) {Leslie Lamport\\entwickelt LaTeX\\(einfachere Nutzung)};
    
    \pause
    \node[below,text width=4cm,align=center] at (8,-0.3) {Jonathan Kew\\entwickelt XeTeX\\(Unicode-Support)};
    
    \pause
    \node[below,text width=2.5cm,align=center] at (11,-0.3) {ShareLaTeX/\\Overleaf\\(kollaborativ im Browser)};
\end{tikzpicture}%
}

\end{frame}

\section[LaTeX vs Word]{Was unterscheidet LaTeX von Word?}

\begin{frame}[fragile]{Paradigmenwechsel: WYSIWYG vs. Markup}
\begin{columns}[c]
\begin{column}{0.48\textwidth}
    \centering
    \textbf{Word (WYSIWYG)}
    
    \vspace{0.5em}
    \begin{figure}
        \centering
        \includegraphics[width=\textwidth]{img/wysiwyg.png}
    \end{figure}
\end{column}
\pause
\begin{column}{0.48\textwidth}
    \centering
    \textbf{LaTeX (Markup)}


    \tiny
    \begin{minted}{latex}
\section{Serious Academic Work}

Needs much dedication and grounds on \textbf{bold ideas}.

But never forget your \textit{work life balance}.
    \end{minted}

\end{column}
\end{columns}

\vspace{1em}
\pause
\begin{block}{Auszeichnungssprache}
LaTeX ist eine Auszeichnungssprache wie HTML oder Markdown -- Inhalt wird strukturell beschrieben, nicht visuell gestaltet.
\end{block}
\end{frame}

\section[Pro \& Contra]{Vor- und Nachteile}

\begin{frame}{Pro \& Contra: LaTeX}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
    \begin{probox}
    \begin{itemize}
        \item<1-> Extrem komplexe mathematische Formeln
        \item<2-> Management von Fußnoten und Zitationen
        \item<3-> Professionelles Layouting ohne gestalterische Vorerfahrung
        \item<4-> Open Source mit vielen Erweiterungen
    \end{itemize}
    \end{probox}
\end{column}
\begin{column}{0.48\textwidth}
    \begin{contrabox}
    \begin{itemize}
        \item<5-> Schwierigeres Bearbeiten: Visuelle Elemente müssen mit Code verknüpft werden
        \item<6-> Neues Bearbeitungsparadigma, schwer zu lernen
        \item<7-> Antike Software auf der alles aufbaut
        \item<8-> Compiler-Fehler in meinem Textdokument!
    \end{itemize}
    \end{contrabox}
\end{column}
\end{columns}
\end{frame}

\section[Syntax]{Wie sieht LaTeX aus?}

\begin{frame}[fragile]{Vergleich: HTML, Markdown, LaTeX}

\tiny
\begin{minted}{html}
<!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="UTF-8">
  <title>Mein erstes 
  LaTeX-Dokument</title>
</head>
<body>
  <h1>Mein erstes 
  LaTeX-Dokument</h1>
  <p><strong>Autor:</strong> 
  Hubert Farnsworth
  <sup>1</sup></p>
  <p><strong>Datum:</strong> 
  August 2022</p>
  <p><sup>1</sup>Finanziert 
  durch das Overleaf-Team.</p>
</body>
</html>
\end{minted}
\end{frame}

\begin{frame}[fragile]{Vergleich: HTML, Markdown, LaTeX}


\tiny
\begin{minted}{markdown}
# Mein erstes LaTeX-Dokument

**Autor:** Hubert Farnsworth[^1]  
**Datum:** August 2022

Wir haben nun unserem ersten 
**LaTeX**-Dokument einen Titel, einen 
Autor und ein Datum hinzugefugt!

[^1]: Finanziert durch das Overleaf-Team.
\end{minted}
\end{frame}

\begin{frame}[fragile]{Vergleich: HTML, Markdown, LaTeX}

\tiny
\begin{minted}{latex}
\documentclass[12pt, letterpaper]{article}

\title{Mein erstes LaTeX-Dokument}

\author{Hubert Farnsworth\thanks{Finanziert durch das Overleaf-Team.}}

\date{August 2022}

\begin{document}
\maketitle

Wir haben nun unserem ersten \LaTeX{} Dokument einen Titel, einen Autor und ein Datum hinzugefugt!

\end{document}
\end{minted}
\end{frame}


\section[Erste Schritte]{Erste Schritte mit LaTeX}

\begin{frame}{Wo erstelle ich meine Dokumente?}
\begin{itemize}
    \item \textbf{Klassisches Kompilieren auf dem Computer}
    \begin{itemize}
        \item pdflatex, xelatex, lualatex
        \item Editoren: TeXstudio, TeXmaker, VS Code
    \end{itemize}
    \pause
    \item \textbf{Online-Editoren (empfohlen für Einsteiger)}
    \begin{itemize}
        \item \href{https://overleaf.com}{Overleaf} (kommerziell)
        \item \href{https://git.bau-ha.us}{git.bau-ha.us}
        \item \href{https://academiccloud.de/services/sharelatex}{academiccloud.de/services/sharelatex}
    \end{itemize}
\end{itemize}

\pause
\vspace{1em}
\begin{center}
\begin{tikzpicture}
    \node[draw,thick,rectangle,minimum width=3cm,minimum height=3cm] at (0,0) {
        \qrcode[height=2.5cm]{https://sharelatex.gwdg.de/saml/login}
    };
    \node[below] at (0,-2) {\small sharelatex.gwdg.de/saml/login};
\end{tikzpicture}
\end{center}
\end{frame}


\section[Grundlagen]{Grundlagen von LaTeX-Dokumenten}

\begin{frame}[fragile]{Ein Dokument ist mehr als eine Datei}

\centering
\begin{tikzpicture}[x=1cm,y=1cm,>=Stealth,thick]
    \node[draw,rounded corners,fill=palette5!15,minimum width=2.6cm,minimum height=1cm] (src) at (0,0) {Quelldateien};
    \node[draw,rounded corners,fill=palette4!15,minimum width=2.6cm,minimum height=1cm] (tex) at (3.2,0) {LaTeX-Compiler};
    \node[draw,rounded corners,fill=palette2!15,minimum width=2.6cm,minimum height=1cm] (pdf) at (6.4,0) {PDF-Dokument};
    \draw[->] (src) -- (tex);
    \draw[->] (tex) -- (pdf);
    \node[below=0.2cm of src,align=center,font=\scriptsize] {*.tex, *.bib, *.sty, Bilder};
    \node[below=0.2cm of tex,align=center,font=\scriptsize] {pdflatex / xelatex};
    \node[below=0.2cm of pdf,align=center,font=\scriptsize] {*.pdf};
\end{tikzpicture}

\begin{itemize}
    \item Ein LaTeX-Dokument wird beim Kompilieren in eine PDF-Datei umgewandelt.
    \item Oft ist es mehr als eine Quelldatei, die für das Kompilieren benötigt wird, die imselben Ordner liegen.
    \item Dabei entstehen zusätzlich Hilfsdateien wie \texttt{.aux}, \texttt{.toc}, \texttt{.log} und \texttt{.pdf}.
\end{itemize}

\end{frame}

\begin{frame}[fragile]{Umgebung vs. Befehl}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\textbf{Umgebung}
\begin{minted}{latex}
\begin{document}
  Das ist mein erstes LaTeX-Dokument!
\end{document}
\end{minted}
\begin{minted}{latex}
...
\begin{itemize}
  \item Punkt 1
  \item Punkt 2
\end{itemize}
...
\end{minted}
\small Eine Umgebung hat einen Anfang und ein Ende und umrahmt einen Inhaltsbereich.
\end{column}
\begin{column}{0.48\textwidth}
\textbf{Befehl}
\begin{minted}{latex}
\title{Akademische Abhandlung}
\author{Monika Musterfrau}
\date{Juli 2026}

\maketitle
\end{minted}
\begin{minted}{latex}
\section{Titel}
\end{minted}
\small Ein Befehl wirkt direkt an einer Stelle.
\end{column}
\end{columns}
\end{frame}

\section[Formatierung]{Einfache Formatierungen}

\begin{frame}[fragile]{Bold, Italic, Underline}
\begin{columns}[c]
\begin{column}{0.48\textwidth}
\begin{minted}{latex}
Some of the \textbf{greatest}
discoveries in 
\underline{science} 
were made by 
\textbf{\textit{accident}}.
\end{minted}
\end{column}
\pause
\begin{column}{0.48\textwidth}
\begin{resultbox}
Some of the \textbf{greatest}
discoveries in \underline{science} 
were made by \textbf{\textit{accident}}.
\end{resultbox}
\end{column}
\end{columns}

\vspace{1em}
\pause
\begin{itemize}
    \item \texttt{\textbackslash textbf\{\}} -- Fettdruck
    \item \texttt{\textbackslash textit\{\}} -- Kursiv
    \item \texttt{\textbackslash underline\{\}} -- Unterstrichen
\end{itemize}
\end{frame}

\section[Bilder]{Bilder einfügen}

\begin{frame}[fragile]{Neues Konzept: Pakete}
\begin{alertblock}{Pakete erweitern LaTeX}
LaTeX bringt nur einen minimalen Werkzeugkasten -- dieser muss mit Paketen erweitert werden!
\end{alertblock}

\pause
\vspace{1em}
\begin{minted}{latex}
\usepackage{graphicx}
\end{minted}

\pause
\begin{itemize}
    \item Pakete werden \alert{vor} \texttt{\textbackslash begin\{document\}} geladen
    \item \texttt{graphicx} ermöglicht das Einfügen von Bildern
    \item Tausende Pakete verfügbar für alle Zwecke
\end{itemize}
\end{frame}

\begin{frame}[fragile]{Bilder einfügen: Grundlagen}
\begin{columns}[T]
\begin{column}{0.55\textwidth}

\tiny
\begin{minted}{latex}
\documentclass{article}
\usepackage{graphicx}
 
\begin{document}
The universe is immense and 
it seems to be homogeneous, 
on a large scale, everywhere 
we look.

\includegraphics{universe}  
 
There's a picture of a 
galaxy above.
\end{document}
\end{minted}
\end{column}

\begin{column}{0.43\textwidth}
\begin{resultbox}
\scriptsize
The universe is immense and it seems to be homogeneous, on a large scale, everywhere we look.

\vspace{0.5em}
\centering
\fbox{\includegraphics[width=0.8\textwidth]{img/universe.jpg}}

\vspace{0.5em}
There's a picture of a galaxy above.
\end{resultbox}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[fragile]{Bildunterschriften, Labels und Referenzen}
\begin{columns}[T]
\begin{column}{0.55\textwidth}
\footnotesize
 \begin{minted}{latex}
\documentclass{article}
\usepackage{graphicx}
 
\begin{document}

\begin{figure}[h]
    \centering
    \includegraphics[
    width=0.75\textwidth]{mesh}
    \caption{A nice plot.}
    \label{fig:mesh1}
\end{figure}
 
As you can see in figure 
\ref{fig:mesh1}, the function 
grows near the origin. 
\end{document}
\end{minted}
\end{column}

\begin{column}{0.43\textwidth}
\begin{resultbox}
\begin{figure}[h]
    \centering
    \fbox{\includegraphics[width=0.7\textwidth]{img/mesh.png}}
    \caption{A nice plot.}
    \label{fig:examplemesh}
\end{figure}

\vspace{0.5em}
\scriptsize
As you can see in figure \ref{fig:examplemesh}, the function grows near the origin.
\end{resultbox}
\end{column}
\end{columns}

\pause
\vspace{0.5em}
\alert{Labels ermöglichen automatische Referenzen -- Nummerierung passt sich an!}
\end{frame}

\section[Tabellen]{Tabellen}

\begin{frame}[fragile]{Tabellen funktionieren ähnlich}
\begin{columns}[c]
\begin{column}{0.48\textwidth}
\begin{minted}{latex}
\begin{center}
\begin{tabular}{ c c c }
 cell1 & cell2 & cell3 \\
 \hline 
 cell4 & cell5 & cell6 \\  
 cell7 & cell8 & cell9    
\end{tabular}
\end{center}
\end{minted}
\end{column}
\pause
\begin{column}{0.48\textwidth}
\begin{resultbox}
\begin{center}
\begin{tabular}{ c c c }
 cell1 & cell2 & cell3 \\
 \hline 
 cell4 & cell5 & cell6 \\  
 cell7 & cell8 & cell9    
\end{tabular}
\end{center}
\end{resultbox}
\end{column}
\end{columns}

\vspace{1em}
\pause
\begin{itemize}
    \item \texttt{\&} trennt Spalten
    \item \texttt{\textbackslash\textbackslash} beendet Zeilen
    \item \texttt{\textbackslash hline} erzeugt horizontale Linie
\end{itemize}
\end{frame}

\section[Mathematische Formeln]{Mathematische Formeln}

\begin{frame}{LaTeX-Mathematik: Überall zu finden}
\begin{block}{Mathematik-Syntax von LaTeX ist allgegenwärtig}
Die LaTeX-Mathematik-Syntax wird heute überall verwendet -- auch ohne LaTeX selbst!
\end{block}

\pause
\vspace{1em}
\begin{itemize}
    \item \textbf{MathJax \& KaTeX:} Rendern LaTeX-Mathematik im Browser
    \pause
    \item \textbf{Markdown:} GitHub, Stack Overflow, Reddit unterstützen LaTeX-Formeln
    \pause
    \item \textbf{\href{https://support.microsoft.com/de-de/office/formeln-im-linearen-format-mithilfe-von-unicodemath-und-latex-in-word-2e00618d-b1fd-49d8-8cb4-8d17f25754f8}{Word} \& Google Docs:} Verwenden LaTeX-Syntax für Formeln
    \pause
    \item \textbf{Notebooks:} Jupyter, Observable verwenden LaTeX-Mathematik
    \pause
    \item \textbf{ChatGPT, Claude, etc.:} Verstehen und rendern LaTeX-Formeln
\end{itemize}

\pause
\vspace{1em}
\alert{LaTeX-Mathematik ist populärer als LaTeX selbst!}
\end{frame}

\begin{frame}[fragile]{Inline vs. Display-Mathematik}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\textbf{Inline (im Text):}
\footnotesize
\begin{minted}{latex}
Der Satz des Pythagoras 
$a^2 + b^2 = c^2$ 
gilt für rechtwinklige 
Dreiecke.
\end{minted}

\small
\vspace{0.5em}
\begin{resultbox}
Der Satz des Pythagoras $a^2 + b^2 = c^2$ gilt für rechtwinklige Dreiecke.
\end{resultbox}
\end{column}

\pause
\begin{column}{0.48\textwidth}
\textbf{Display (abgesetzt):}
\footnotesize
\begin{minted}{latex}
Der Satz des Pythagoras:
\[
a^2 + b^2 = c^2
\]
gilt für rechtwinklige 
Dreiecke.
\end{minted}

\small
\vspace{0.5em}
\begin{resultbox}
Der Satz des Pythagoras:
\[
a^2 + b^2 = c^2
\]
gilt für rechtwinklige Dreiecke.
\end{resultbox}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[fragile]{Die verschiedenen Syntaxen}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\textbf{Inline-Mathematik:}
\footnotesize
\begin{minted}{latex}
$E = mc^2$
\(E = mc^2\)
\end{minted}

\small
\vspace{0.5em}
\textbf{Display-Mathematik:}
\footnotesize
\begin{minted}{latex}
$$E = mc^2$$
\[E = mc^2\]
\begin{equation}
E = mc^2
\end{equation}
\end{minted}
\end{column}

\pause
\begin{column}{0.48\textwidth}
\textbf{Unterschiede:}
\small
\begin{itemize}
    \item \texttt{\$...\$} -- Einfach, aber alte Tex-Syntax
    \pause
    \item \texttt{\textbackslash(...\textbackslash)} -- LaTeX-Standard für inline
    \pause
    \item \texttt{\$\$...\$\$} -- Alt, funktioniert, nicht empfohlen
    \pause
    \item \texttt{\textbackslash[...\textbackslash]} -- LaTeX-Standard für display
    \pause
    \item \texttt{equation} -- Nummerierte Formel
\end{itemize}

\pause
\vspace{0.5em}
\alert{Moderne LaTeX-Dokumente verwenden \texttt{\textbackslash(...\textbackslash)} und \texttt{\textbackslash[...\textbackslash]}!}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[fragile]{Beispiele: Einfache Formeln}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\textbf{Code:}
\footnotesize
\begin{minted}{latex}
Die quadratische Formel:
\[
x = \frac{-b \pm 
\sqrt{b^2-4ac}}{2a}
\]

Eulers Identität:
\(e^{i\pi} + 1 = 0\)
\end{minted}
\end{column}

\pause
\begin{column}{0.48\textwidth}
\begin{resultbox}
\small
Die quadratische Formel:
\[
x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}
\]

Eulers Identität: \(e^{i\pi} + 1 = 0\)
\end{resultbox}
\end{column}
\end{columns}

\pause
\vspace{1em}
\begin{itemize}
    \item \texttt{\textbackslash frac\{a\}\{b\}} -- Bruch
    \item \texttt{\textbackslash sqrt\{x\}} -- Wurzel
    \item \texttt{\textbackslash pm} -- Plus-Minus
    \item \texttt{\textbackslash pi} -- Pi
\end{itemize}
\end{frame}

\begin{frame}[fragile]{Nummerierte Formeln}
\begin{columns}[T]
\begin{column}{0.55\textwidth}
\textbf{Code:}
\footnotesize
\begin{minted}{latex}
\begin{equation}
\int_{-\infty}^{\infty} 
e^{-x^2} dx = \sqrt{\pi}
\label{eq:gaussian}
\end{equation}

Wie in Gleichung 
\ref{eq:gaussian} gezeigt...
\end{minted}
\end{column}

\pause
\begin{column}{0.43\textwidth}
\begin{resultbox}
\begin{equation}
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
\label{eq:gaussian}
\end{equation}

Wie in Gleichung \ref{eq:gaussian} gezeigt...
\end{resultbox}
\end{column}
\end{columns}

\pause
\vspace{1em}
\begin{itemize}
    \item \texttt{equation} -- Automatische Nummerierung
    \item \texttt{\textbackslash label} -- Referenz setzen
    \item \texttt{\textbackslash ref} -- Referenz verwenden
\end{itemize}
\end{frame}

\begin{frame}[fragile]{Ausgerichtete Formeln: align}
\begin{columns}[T]
\begin{column}{0.5\textwidth}
\textbf{Code:}
\tiny
\begin{minted}{latex}
\begin{align}
(a+b)^2 &= a^2 + 2ab + b^2 \\
(a-b)^2 &= a^2 - 2ab + b^2 \\
a^2 - b^2 &= (a+b)(a-b)
\end{align}
\end{minted}
\end{column}

\pause
\begin{column}{0.5\textwidth}
\begin{resultbox}
\begin{align}
(a+b)^2 &= a^2 + 2ab + b^2 \\
(a-b)^2 &= a^2 - 2ab + b^2 \\
a^2 - b^2 &= (a+b)(a-b)
\end{align}
\end{resultbox}
\end{column}
\end{columns}

\pause
\vspace{1em}
\begin{itemize}
    \item \texttt{\&} -- Ausrichtungspunkt
    \item \texttt{\textbackslash\textbackslash} -- Neue Zeile
    \item Jede Zeile wird nummeriert
\end{itemize}
\end{frame}

\begin{frame}[fragile]{Weitere nützliche Befehle}
\begin{columns}[T,onlytextwidth]
\begin{column}{0.48\textwidth}
\textbf{Griechische Buchstaben:}
\footnotesize
\begin{minted}{latex}
\alpha, \beta, \gamma
\Delta, \Omega, \Pi
\end{minted}
\end{column}

\begin{column}{0.48\textwidth}
\begin{resultbox}
$\alpha, \beta, \gamma$ \\ 
$\Delta, \Omega, \Pi$
\end{resultbox}
\end{column}
\end{columns}

\vspace{0.8em}

\begin{columns}[T,onlytextwidth]
\begin{column}{0.48\textwidth}
\textbf{Operatoren:}
\footnotesize
\begin{minted}{latex}
\sum, \prod, \int
\lim, \sin, \cos
\end{minted}
\end{column}

\begin{column}{0.48\textwidth}
\begin{resultbox}
$\sum, \prod, \int$ \\ 
$\lim, \sin, \cos$
\end{resultbox}
\end{column}
\end{columns}
\end{frame}



\begin{frame}{Das Problem: Literatur verwalten}

    \begin{columns}[T]
    \begin{column}{0.48\textwidth}
    \begin{contrabox}[Manuelle Verwaltung]
    \begin{itemize}
        \item Quellen mehrfach eingeben
        \item Änderungen leicht fehleranfällig
        \item Literaturverzeichnis aktualisieren
    \end{itemize}
    \end{contrabox}
    \end{column}
    
    \pause
    
    \begin{column}{0.48\textwidth}
    \begin{probox}[LaTeX + \texttt{biblatex}]
    \begin{itemize}
        \item Quellen zentral speichern
        \item klickbare Verweise
        \item generiertes Literaturverzeichnis
        \item Zitierstil einfach wechselbar
    \end{itemize}
    \end{probox}
    \end{column}
    \end{columns}
    
    \vspace{1em}
    
    \pause
    
    \begin{block}{Die Grundidee}
    Literaturangaben werden einmal in einer
    \texttt{.bib}-Datei gespeichert.
    LaTeX übernimmt anschließend Zitate,
    Literaturverzeichnis und Formatierung automatisch.
    \end{block}
    
    \end{frame}

\begin{frame}[fragile]{BibTeX: Die Grundidee}
\begin{columns}[T]
\begin{column}{0.55\textwidth}
\textbf{Bibliographie-Datei (\texttt{literatur.bib}):}
\footnotesize
\begin{minted}{latex}
@article{knuth1984,
  author = {Knuth, Donald E.},
  title = {Literate Programming},
  journal = {The Computer Journal},
  year = {1984},
  volume = {27},
  pages = {97--111}
}

@book{lamport1994,
  author = {Lamport, Leslie},
  title = {LaTeX: A Document Preparation System},
  publisher = {Addison-Wesley},
  year = {1994}
}
\end{minted}
\end{column}
\pause
\begin{column}{0.43\textwidth}
\textbf{Im Dokument:}
\footnotesize
\begin{minted}{latex}
\documentclass{article}
\usepackage[style=numeric]
  {biblatex}
\addbibresource {literatur.bib}

\begin{document}
Knuth entwickelte 
\cite{knuth1984} 
das Konzept...

\printbibliography
\end{document}
\end{minted}
\end{column}
\end{columns}
\end{frame}

\begin{frame}{Zitationsstile: Numerisch vs. Autor-Jahr}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
    \begin{tcolorbox}[colback=bg,colframe=gray,title=\textbf{Numerisch}]
    \textbf{Im Text:}
    
    LaTeX wurde entwickelt [1], um...
    
    \vspace{0.5em}
    \textbf{Im Literaturverzeichnis:}
    
    [1] L. Lamport, \textit{LaTeX: A Document Preparation System}, Addison-Wesley, 1994.
    \end{tcolorbox}
\end{column}
\pause
\begin{column}{0.48\textwidth}
    \begin{tcolorbox}[colback=bg,colframe=gray,title=\textbf{Autor-Jahr}]
    \textbf{Im Text:}
    
    LaTeX wurde entwickelt (Lamport, 1994), um...
    
    \vspace{0.5em}
    \textbf{Im Literaturverzeichnis:}
    
    Lamport, L. (1994). \textit{LaTeX: A Document Preparation System}. Addison-Wesley.
    \end{tcolorbox}
\end{column}
\end{columns}

\end{frame}

\begin{frame}[fragile]{Verschiedene Zitationsarten}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\textbf{Standard-Zitation:}
\footnotesize
\begin{minted}{latex}
\cite{knuth1984}
\end{minted}
\begin{resultbox}
\small
[1]
\end{resultbox}

\vspace{0.5em}
\pause
\textbf{Mehrere Quellen:}
\footnotesize
\begin{minted}{latex}
\cite{knuth1984,lamport1994}
\end{minted}
\begin{resultbox}
\small
[1, 2]
\end{resultbox}

\vspace{0.5em}
\pause
\textbf{Seitenangabe:}
\footnotesize
\begin{minted}{latex}
\cite[Seite 42]{knuth1984}
\end{minted}
\begin{resultbox}
\small
[1, Seite 42]
\end{resultbox}
\end{column}
\pause
\begin{column}{0.48\textwidth}
\textbf{Im Text zitieren:}
\footnotesize
\begin{minted}{latex}
\citet{knuth1984}
\end{minted}
\begin{resultbox}
\small
Knuth (1984)
\end{resultbox}

\vspace{0.5em}
\pause
\textbf{In Klammern:}
\footnotesize
\begin{minted}{latex}
\citep{knuth1984}
\end{minted}
\begin{resultbox}
\small
(Knuth, 1984)
\end{resultbox}

\vspace{0.5em}
\pause
\textbf{Fußnote:}
\footnotesize
\begin{minted}{latex}
\footcite{knuth1984}
\end{minted}
\begin{resultbox}
\small
Zitat in Fußnote
\end{resultbox}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[fragile]{BibTeX vs. BibLaTeX}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
    \textbf{BibTeX}
    \footnotesize
    \begin{minted}{latex}
\bibliographystyle{plain}
\bibliography{literatur}
    \end{minted}
    
    \small
    \begin{itemize}
        \item Älter, etabliert
        \item Weniger flexibel
        \item Einfacher Einstieg
    \end{itemize}
\end{column}
\pause
\begin{column}{0.48\textwidth}
    \textbf{BibLaTeX (modern)}
    \footnotesize
    \begin{minted}{latex}
\usepackage[style=authoryear]
  {biblatex}
\addbibresource{literatur.bib}
\printbibliography
    \end{minted}
    
    \small
    \begin{itemize}
        \item Moderner, flexibler
        \item Mehr Stile verfügbar
        \item Bessere Unicode-Unterstützung
    \end{itemize}
\end{column}
\end{columns}

\vspace{1em}
\pause
\begin{alertblock}{Kompilieren}
\texttt{pdflatex} $\rightarrow$ \texttt{bibtex/biber} $\rightarrow$ \texttt{pdflatex} $\rightarrow$ \texttt{pdflatex}
\end{alertblock}
\end{frame}

\begin{frame}{Vorteile von LaTeX-Zitationen}
\begin{itemize}
    \item \textbf{Automatische Nummerierung:} Quellen werden automatisch durchnummeriert
    \pause
    \item \textbf{Konsistenz:} Einheitliches Format im gesamten Dokument
    \pause
    \item \textbf{Einfache Änderungen:} Stil wechseln durch eine Zeile Code
    \pause
    \item \textbf{Wiederverwendbarkeit:} Eine \texttt{.bib} Datei für alle Dokumente
    \pause
    \item \textbf{Fehlerreduktion:} Keine manuellen Tippfehler mehr
    \pause
    \item \textbf{Integration:} Viele Editoren (Zotero, Mendeley) exportieren direkt zu BibTeX
\end{itemize}

\vspace{1em}
\pause
\begin{block}{Praktischer Tipp}
Verwende Referenzmanager wie Zotero oder Mendeley -- sie können direkt BibTeX-Dateien exportieren!
\end{block}
\end{frame}

\section[Trivia]{Fun Fact}

\begin{frame}{LaTeX Trivia}
\begin{center}
\begin{tikzpicture}
    \node[draw,thick,circle,minimum size=4cm,fill=palette2] {
        \begin{minipage}{3.5cm}
        \centering
        \Large $\pi = 3.141592653...$
        \end{minipage}
    };
\end{tikzpicture}
\end{center}

\vspace{1em}
\begin{block}{Fun Fact}
Die Versionsnummern von TeX konvergieren gegen die mathematische Konstante $\pi$.

\vspace{0.5em}
Die aktuelle Version ist \textbf{3.141592653}
\end{block}

\pause
\alert{Donald Knuth's Perfektion kennt keine Grenzen!}
\end{frame}

\begin{frame}{Neue Lernpfade unlocked}
\vspace{0.5em}
\begin{center}
\begin{itemize}
    \item Vertiefung der Grundlagen
    \item Präsentationen erstellen
    \item Typst als moderne Alternative
\end{itemize}
\end{center}

\vspace{1em}
\begin{center}
\Large \textbf{Viel Erfolg mit LaTeX!}
\end{center}
\end{frame}

\end{document}