Kurs:Computer für Psychologen/Sitzung4

Aus Wikiversity

Folien[Bearbeiten]

Datei:Intro2.pdf

Folien (tex-Source)[Bearbeiten]

% (c) 2009 Basil Abou El-Komboz <basil.komboz [at] gmx.de>
% (cc)-by -- Licenced under Creative Commons Attribution unported
% (http://creativecommons.org/licenses/by/3.0/)
%
\documentclass[xcolor={fixpdftex,hyperref,x11names},10pt,pdftex,hyperref={pdftex},handout]{beamer}

% Pakete
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage{amsmath}
\usefonttheme[onlymath]{serif}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\usepackage{fancyvrb}
\usepackage{color}

\useoutertheme{tree}
\useinnertheme{circles}
\usecolortheme{orchid}
\usecolortheme{whale}
%\usecolortheme{blue}

\newcommand\PYZat{@}
\newcommand\PYZlb{[}
\newcommand\PYZrb{]}
\newcommand\PYbg[1]{\textcolor[rgb]{0.00,0.53,0.00}{\textbf{#1}}}
\newcommand\PYbf[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.20,0.20,0.73}{#1}}}
\newcommand\PYbe[1]{\textcolor[rgb]{0.73,0.00,0.40}{\textbf{#1}}}
\newcommand\PYbd[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYbc[1]{\textcolor[rgb]{0.20,0.40,0.60}{\textbf{#1}}}
\newcommand\PYbb[1]{\colorbox[rgb]{0.94,1.00,0.94}{\textcolor[rgb]{0.13,0.73,0.13}{#1}}}
\newcommand\PYba[1]{\textcolor[rgb]{0.19,0.19,0.19}{#1}}
\newcommand\PYaJ[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYaK[1]{\textcolor[rgb]{0.00,0.40,0.73}{\textbf{#1}}}
\newcommand\PYaH[1]{\colorbox[rgb]{0.89,0.82,0.82}{\textcolor[rgb]{0.65,0.09,0.09}{#1}}}
\newcommand\PYaI[1]{\textcolor[rgb]{0.53,0.53,0.53}{\textbf{#1}}}
\newcommand\PYaN[1]{\textcolor[rgb]{0.80,0.00,0.00}{\textbf{#1}}}
\newcommand\PYaO[1]{\textcolor[rgb]{0.73,0.00,0.40}{\textbf{#1}}}
\newcommand\PYaL[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.80,0.00,0.00}{\textbf{#1}}}}
\newcommand\PYaM[1]{\textcolor[rgb]{0.73,0.73,0.73}{#1}}
\newcommand\PYaB[1]{\textcolor[rgb]{0.33,0.33,0.33}{#1}}
\newcommand\PYaC[1]{\textcolor[rgb]{0.00,0.53,0.00}{\textbf{#1}}}
\newcommand\PYaA[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYaF[1]{\textcolor[rgb]{0.67,0.00,0.00}{#1}}
\newcommand\PYaG[1]{\textcolor[rgb]{0.38,0.38,0.38}{#1}}
\newcommand\PYaD[1]{\textcolor[rgb]{0.53,0.53,0.53}{#1}}
\newcommand\PYaE[1]{\colorbox[rgb]{1.00,0.87,0.87}{\textcolor[rgb]{0.00,0.00,0.00}{#1}}}
\newcommand\PYaZ[1]{\textcolor[rgb]{0.73,0.00,0.40}{\textbf{#1}}}
\newcommand\PYaX[1]{\textcolor[rgb]{0.00,0.20,0.53}{#1}}
\newcommand\PYaY[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYaR[1]{\textcolor[rgb]{0.00,0.00,0.87}{\textbf{#1}}}
\newcommand\PYaS[1]{\textcolor[rgb]{0.20,0.20,0.73}{#1}}
\newcommand\PYaP[1]{\textcolor[rgb]{0.33,0.33,0.33}{#1}}
\newcommand\PYaQ[1]{\textcolor[rgb]{0.20,0.40,0.60}{#1}}
\newcommand\PYaV[1]{\textcolor[rgb]{0.73,0.00,0.40}{\textbf{#1}}}
\newcommand\PYaW[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYaT[1]{\textcolor[rgb]{0.00,0.00,0.87}{\textbf{#1}}}
\newcommand\PYaU[1]{\textcolor[rgb]{0.53,0.53,0.53}{#1}}
\newcommand\PYaj[1]{\textcolor[rgb]{0.00,0.53,0.00}{#1}}
\newcommand\PYak[1]{\colorbox[rgb]{1.00,0.94,1.00}{\textcolor[rgb]{0.00,0.53,0.00}{#1}}}
\newcommand\PYah[1]{\textcolor[rgb]{0.20,0.40,0.60}{\textit{#1}}}
\newcommand\PYai[1]{\textcolor[rgb]{0.20,0.40,0.60}{#1}}
\newcommand\PYan[1]{\textcolor[rgb]{0.00,0.00,0.87}{\textbf{#1}}}
\newcommand\PYao[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.00,0.27,0.87}{#1}}}
\newcommand\PYal[1]{\textcolor[rgb]{0.00,0.53,0.00}{\textbf{#1}}}
\newcommand\PYam[1]{\textbf{#1}}
\newcommand\PYab[1]{\textit{#1}}
\newcommand\PYac[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYaa[1]{\textcolor[rgb]{0.53,0.53,0.53}{#1}}
\newcommand\PYaf[1]{\textcolor[rgb]{0.53,0.53,0.53}{#1}}
\newcommand\PYag[1]{\textcolor[rgb]{0.00,0.00,0.87}{\textbf{#1}}}
\newcommand\PYad[1]{\textcolor[rgb]{0.67,0.00,0.00}{#1}}
\newcommand\PYae[1]{\textcolor[rgb]{0.00,0.00,0.87}{\textbf{#1}}}
\newcommand\PYaz[1]{\textcolor[rgb]{0.00,0.20,0.53}{#1}}
\newcommand\PYax[1]{\textcolor[rgb]{0.00,0.53,0.00}{\textbf{#1}}}
\newcommand\PYay[1]{\colorbox[rgb]{0.87,1.00,0.87}{\textcolor[rgb]{0.00,0.00,0.00}{#1}}}
\newcommand\PYar[1]{\textcolor[rgb]{0.87,0.47,0.00}{#1}}
\newcommand\PYas[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.87,0.13,0.00}{#1}}}
\newcommand\PYap[1]{\textcolor[rgb]{0.00,0.53,0.00}{\textbf{#1}}}
\newcommand\PYaq[1]{\textcolor[rgb]{0.00,0.20,0.40}{\textbf{#1}}}
\newcommand\PYav[1]{\textcolor[rgb]{0.00,0.53,0.00}{#1}}
\newcommand\PYaw[1]{\textcolor[rgb]{0.00,0.00,0.87}{\textbf{#1}}}
\newcommand\PYat[1]{\textcolor[rgb]{0.20,0.40,0.60}{#1}}
\newcommand\PYau[1]{\colorbox[rgb]{1.00,0.94,0.94}{\textcolor[rgb]{0.67,0.40,0.00}{#1}}}

% Informationen
\title{\LaTeXe{}}
\subtitle{}
\author{Basil Abou El-Komboz}
\date{16.11.2009}

% Sonstiges
\renewcommand{\emph}[1]{\color{red}#1 \color{black}}


\begin{document}

\maketitle

\begin{frame}
  \frametitle{Überblick}
  \tableofcontents
  \begin{quote}\begin{footnotesize}
Email is a wonderful thing for people whose role in life is to be on top of things. But not for me; my role is to be on the bottom of things. What I do takes long hours of studying and
  uninterruptible concentration.
   \end{footnotesize}
   \hspace{6cm}\scriptsize(Donald Knuth)
  \end{quote}
\end{frame}



\section{Kurzer Rückblick}
\label{sec:kurzer-ruckblick}


\begin{frame}[fragile]
  \frametitle{What have we done so far?}
  \begin{columns}
    \begin{column}{0.6\textwidth}
        \begin{itemize}
  \item Kennenlernen ...
    \begin{itemize}
    \item[...] des \TeX{}-Workflows
    \item[...] des Aufbaus eines \LaTeXe{}-Dokuments
    \item[...] der zwei wichtigsten Befehlsklassen
    \item[...] von Strukturierungsmöglichkeiten für Dokument \& Inhalt
    \item[...] verschiedener Formatierungsmöglichkeiten 
    \end{itemize}
  \item Praktische Umsetzung ...
    \begin{itemize}
    \item[...] einer einfachen \LaTeXe{}-Datei
    \item[...] der Kompilierung dieser Datei
    \item[...] der Spezifizierung verschiedener Optionen
    \item[...] der Text-Formatierung \& Strukturierung 
    \end{itemize}
  \end{itemize}
    \end{column}
    \begin{scriptsize}
    \begin{column}{0.4\textwidth}
\begin{Verbatim}[commandchars=@\[\],fontsize=\scriptsize]
@PYax[\documentclass]@PYaQ[@PYZlb[]a4paper,14pt@PYZrb[]]@PYaX[{]scrartcl@PYaX[}]

@PYax[\author]@PYaX[{]Basil@PYaX[}]
@PYax[\title]@PYaX[{]Gyros mit Tsatziki@PYaX[}]
@PYax[\date]@PYaX[{]@PYax[\today]@PYaX[}]

@PYax[\begin]@PYaX[{]document@PYaX[}]

@PYax[\maketitle]

@PYax[\begin]@PYaX[{]quote@PYaX[}]
  @PYax[\Large] @PYax[\textsc]@PYaX[{]Essen ist gut.@PYaX[}]
@PYax[\end]@PYaX[{]quote@PYaX[}]


Das Gyros ist in Griechenland und ...

@PYax[\section]@PYaX[{]Vorbereitung@PYaX[}]
@PYax[\label]@PYaX[{]sec:vorbereitung@PYaX[}]

5 Tage nichts mehr essen.
@PYax[\end]@PYaX[{]document@PYaX[}]
\end{Verbatim}
\end{column}
\end{scriptsize}
\end{columns}
\end{frame}



\section{Tabellen \& Grafiken}
\label{sec:tabellen--grafiken}

\begin{frame}[fragile]
  \frametitle{(Einfache) Tabellen}
  \begin{columns}
    \begin{column}{0.55\textwidth}
        \begin{itemize}
  \item<2-> \texttt{tabular}-Umgebung zur Erzeugung von Tabellen
  \item<3-> Obligatorisches Argument: Anzahl der Spalten und ihre Ausrichtung (\texttt{c},\texttt{r},\texttt{l}
    bzw. benutzerdefinierte Formate möglich, bspw. \texttt{p\{4cm\}})
  \item<4-> Trennung von Zeilen durch \texttt{\textbackslash \textbackslash}
  \item<5-> Trennung von Spalten durch \texttt{\&}
  \item<6-> Vertikale Linien durch \texttt{\textbackslash hline}
  \end{itemize}
    \end{column}
    \begin{column}{0.45\textwidth}<2->
\begin{Verbatim}[commandchars=@\[\],fontsize=\scriptsize]
@PYax[\begin]@PYaX[{]tabular@PYaX[}]@PYaX[{]lcr@PYaX[}]
@PYax[\textbf]@PYaX[{]T1@PYaX[}] @PYaX[&] @PYax[\textbf]@PYaX[{]T2@PYaX[}] @PYaX[&] @PYax[\textbf]@PYaX[{]T3@PYaX[}]@PYax[\\]
  @PYax[\hline]
  S1 @PYaX[&] S2 @PYaX[&] S3 @PYax[\\]@PYaQ[@PYZlb[]2.5mm@PYZrb[]]
  I1 @PYaX[&] I2 @PYaX[&] I3 @PYax[\\]
  @PYax[\hline]
  L1 @PYaX[&] L2 @PYaX[&] l3 @PYax[\\]
@PYax[\end]@PYaX[{]tabular@PYaX[}]
\end{Verbatim}
\vspace{0.5cm}
\begin{center}
\begin{tabular}{l|cr}
  \textbf{T1} & \textbf{T2} & \textbf{T3}\\
  \hline
  S1 & S2 & S3 \\[2.5mm]
  I1 & I2 & I3 \\
  \hline
  L1 & L2 & l3 \\
\end{tabular}
\end{center}
\end{column}
  \end{columns}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Grafiken}
  \begin{columns}
    \begin{column}{0.5\textwidth}
    \begin{itemize}
    \item<2-> In \TeX{} erzeugte Grafiken (Bspw. mit PSTricks oder Ti\textit{k}Z)
      \begin{itemize}
      \item<2-> Direkte Einbindung im Code
      \end{itemize}
    \item<3-> Externe Grafiken verschiedener Formate
      \begin{itemize}
      \item<4-> Je nach Format evtl. Umwandlung notwendig
      \item<5-> Einbindung mittels Zusatzpaket \texttt{graphicx}
      \end{itemize}
    \end{itemize}
    \end{column}
    \begin{column}{0.5\textwidth}<6->
\begin{Verbatim}[commandchars=@\[\],fontsize=\scriptsize]
@PYax[\begin]@PYaX[{]tikzpicture@PYaX[}]
  @PYax[\node] (start) @PYZlb[]draw,shape=ellipse@PYZrb[] 
         @PYaX[{]Ti@PYax[\textit]@PYaX[{]k@PYaX[}]Z@PYaX[}];
  @PYax[\foreach] @PYax[\angle] in @PYaX[{]-90, -80, ..., 90@PYaX[}]
  @PYax[\draw] (node cs:name=start,angle=@PYax[\angle])
  .. controls +(@PYax[\angle]:1cm) and 
          +(-1,0) .. (2.5,0);
@PYax[\end]@PYaX[{]tikzpicture@PYaX[}]
\end{Verbatim}
\begin{center}
\begin{tikzpicture}
        \node (start) [draw,shape=ellipse] {Ti\textit{k}Z};
        \foreach \angle in {-90, -80, ..., 90}
          \draw (node cs:name=start,angle=\angle)
       .. controls +(\angle:1cm) and +(-1,0) .. (2.5,0);
     \end{tikzpicture}
   \end{center}
 \end{column}
  \end{columns}
\end{frame}

\begin{frame}[fragile,<+->]
  \frametitle{Floating}
  \setbeamercolor{block title}{bg=folgerung}
  \begin{Problem}<1->
    Meine Tabelle/Grafik ist zu groß für den Rest der zur Verfügung stehenden Seite.
  \end{Problem}
     \setbeamercolor{block title}{bg=definition}
  \begin{Loesung}<2->
    \TeX{} sucht einen geeigneten Platz (möglichst in Nähe meines ursprünglichen) Einfügeorts, an dem sich das Objekt
    einfügen lässt, ohne das ``Seitenbild'' zu stören. Hierzu muss ich \TeX{} mitteilen, dass es das mit meinem Objekt tun
    darf, also dass mein Objekt ein ``Float-Objekt'' ist.
  \end{Loesung}
  \begin{columns}
    \begin{column}{0.5\textwidth}
        \begin{itemize}
  \item<3-> Umgebungen \texttt{figure} und \texttt{table} teilen \TeX{} mit, dass es sich um Float-Objekte handelt
  \item<4-> Optionale Argumente erlauben Einschränkung
  \end{itemize}
\end{column}
    \begin{column}{0.5\textwidth}<3->
\begin{Verbatim}[commandchars=@\[\],fontsize=\scriptsize]
@PYax[\begin]@PYaX[{]figure@PYaX[}]@PYZlb[]!htbp@PYZrb[]
  @PYax[\indcludegraphics]@PYaQ[@PYZlb[]height=5cm@PYZrb[]]
                 @PYaX[{]meinetollegrafik.png@PYaX[}]
  @PYax[\caption]@PYaX[{]Bildunterschrift@PYaX[}]
  @PYax[\label]@PYaX[{]fig:bild1@PYaX[}]
@PYax[\end]@PYaX[{]figure@PYaX[}]
\end{Verbatim}
    \end{column}
  \end{columns}
\end{frame}


\section{Pakete}
\label{sec:pakete}

\begin{frame}[fragile]
  \frametitle{Pakete}
  \begin{itemize}
  \item<2-> Erweiterung der \LaTeXe -Funktionalität durch neue (High-Level)-Befehle
  \item<3-> Vielzahl an existierenden Paketen zu allen möglichen Problemstellungen (siehe \texttt{http://www.ctan.org})
  \item<4-> Laden eines Pakets mittels folgendem Befehl:
\begin{Verbatim}[framesep=2.5mm,frame=single,fontsize=\footnotesize,commandchars=@\[\]]
@PYax[\usepackage]@PYaP[@PYZlb[]Optionen@PYZrb[]]@PYaW[{]Paketname@PYaW[}]
\end{Verbatim}
\item<5-> Wichtige Pakete für deutsche Texte (am besten standardmäßig laden)\\[0.25cm]
  \onslide<5->{\begin{footnotesize}
  \begin{tabular}[h]{llp{5cm}}
    \textbf{Name} & \textbf{Optionen} & \textbf{Wirkung}\\
    \midrule
    \texttt{inputenc} & \texttt{latin1} bzw. \texttt{utf8} & Erlaubt u.a. Eingabe von Sonderzeichen und deutschen Umlauten\\
    \texttt{fontenc} & -- & Silbentrennung bei Worten mit deutschen Umlauten \\
    \texttt{babel} & \texttt{ngerman} & U.a. deutsche Begriffe für Gliederungsüberschriften\\
  \end{tabular}
\end{footnotesize}}
\end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Übung -- Vorstellung deines Lieblingsgerichts III}
\begin{footnotesize}
  \begin{enumerate}
  \item Nutze das \texttt{graphicx}-Paket, welches du zuvor in der Präambel lädst um eine tolle Grafik unter dein Rezept
    einzufügen. Informiere dich mittels der \texttt{graphicx}-Manual über die Struktur des \texttt{\textbackslash
      includegraphics}-Befehls und seine möglichen Optionen. Da du schon dabei bist, Pakete zu laden, lädst du auch gleich
    das \texttt{inputenc}, das \texttt{fontenc} und das \texttt{babel}-Paket mit den für deutschsprachigen Texte sinnvollen Optionen.
  \item Zentriere deine Grafik unter deinem Rezept.
  \item Damit \TeX{} einen schönen Ort für deine Grafik aussuchen kann, möchtest du ``ihm'' mitteilen, dass es sich bei deinem
    Bild um ein Float-Objekt handelt. Dabei möchtest du aber auch klarstellen, dass du deine Grafik am liebsten an der Stelle
    haben möchtest, an der sie auch im Quellcode steht.
  \item Damit der Leser schnell weiß, um was es in deiner Grafik geht, fügst du noch eine aussagekräftige Bildunterschrift hinzu.
  \item Stolz auf deine erste \TeX{}-Publikation möchtest du dir für die Zukunft ein wenig Arbeit ersparen. Hierfür erstellst
    du dir aus deiner ersten \TeX{}-Datei eine Vorlage, indem du alle spezifischen Inhalte löscht und nur die
    Grundstruktur als \texttt{vorlage.tex} abspeicherst.
  \end{enumerate}
\end{footnotesize}
\end{frame}


\section{Literatur}
\label{sec:literatur}

\begin{frame}
  \frametitle{There is a lot more to learn...}
  \begin{itemize}
  \item Bücher (Auswahl)
    \begin{itemize}
    \item Der \LaTeX -Begleiter (Frank Mittelbach, Michel Goossens, Johannes Braams, David Carlisle, Chris Rowley)
    \item \LaTeX{} (Band 1-3, Helmut Kopka)
    \end{itemize}
  \item Webseiten (Auswahl)
    \begin{itemize}
    \item \texttt{http://www.ctan.org}
    \item \texttt{http://www.dante.de}
    \end{itemize}
  \item Tutorials (Auswahl)
    \begin{itemize}
    \item The Not So Short Introduction to \LaTeXe
    \item The UK \TeX{} FAQ
    \end{itemize}

  \end{itemize}
\end{frame}


\end{document}