Project

General

Profile

Documents / PPS-PV-2012-06-09 / PV-2012-Latex

Vortrag über LaTeX (Source Code) corvus, 10 June 2012 22:23

 
\documentclass{beamer}
\usetheme{Dresden}
\usecolortheme{crane}
\usefonttheme{professionalfonts}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{arrows,shapes}
\useinnertheme{rounded}
\useoutertheme{shadow}
\beamertemplatenavigationsymbolsempty
%\setbeamertemplate{footline}[frame number]
\definecolor{orange1}{RGB}{253,195,0}
\definecolor{orange2}{RGB}{240,138,0}
\definecolor{green1}{RGB}{20,160,20}
\setbeamertemplate{background canvas}[vertical shading][top=orange1,bottom=orange2]
%\setbeamertemplate{background canvas}[vertical shading][top=[rgb]{1,0,0},bottom=[rgb]{0,1,0}]
\title[Piraten-\LaTeX]{Piraten-\LaTeX}
\author[T. Bruderer]{Thomas Bruderer, President Pirate Party Switzerland}
\institute[Pirate Party Switzerland]{}
\date[10.06.2012]{}
\logo{ \includegraphics[width=4.00cm,height=2.00cm]{ppLogo-stnego-de-cmyk.pdf}\vspace{-0.8cm}}
\titlegraphic{\vspace{-2.5cm}\includegraphics[width=8cm,height=4cm]{ppLogo-wwneg-de-cmyk.pdf}}
\subject{Pirate Party}

\begin{document}
\section{Inhalt}

\subsection {Titel}
\frame{
\titlepage
}

\subsection {Index}
\frame{
\frametitle{Index}
\tableofcontents[sections={1-2}]
}

\frame{
\frametitle{Index}
\tableofcontents[sections={3}]
}

\frame{
\frametitle{Index}
\tableofcontents[sections={4-5}]
}

\section{\LaTeX -Essentials}

\subsection{Latex on Windows}

\begin{frame}{Essential Tools}
\begin{block}{Distribution}
MikTex (http://miktex.org/)
\end{block}

\begin{block}{Editor}
\begin{itemize}
\item Notepad++
\item TeXnicCenter
\item TexMaker
\end{itemize}
\end{block}
\end{frame}

\subsection{Latex on Linux}

\begin{frame}{Essential Tools}
\begin{block}{Distribution}
TexLive (sudo apt-get install texlive-full)
\end{block}

\begin{block}{Editor}
\begin{itemize}
\item emacs
\item vi
\item nano
\item TexMaker
\end{itemize}
\end{block}
\end{frame}

\subsection{git On Windows}

\begin{frame}{git}
\begin{block}{git}
git (http://git-scm.com/)
tortoise git (http://code.google.com/p/tortoisegit/)
\end{block}
\end{frame}

\begin{frame}{git clone}
\begin{block}{git clone}
\begin{itemize}
\item Explorer right click
\item Git Clone...
\item Url: http://projects.piratenpartei.ch/git/mmd.git
\end{itemize}
\end{block}
\end{frame}

\subsection{git On Linux}

\begin{frame}{git}
\begin{block}{git}
sudo apt-get install git
\end{block}
\end{frame}

\begin{frame}{git}
\begin{block}{git}
git clone http://projects.piratenpartei.ch/git/mmd.git
\end{block}
\end{frame}

\section{\LaTeX -Basics}

\subsection{Write... simple things}
\begin{frame}[fragile]
\begin{block}{Lets start...}
\begin{verbatim}
Simple text is just simple text \\ < new line
nowadays ??? should work out of the box
$formulas go between$
Special charcters: \ { } _ ^ # & $ % ~
need to be escaped with \
\chapter, \section, \subsection, \subsubsection
% Comments start with a percent sign
\end{verbatim}
\end{block}
\end{frame}

\subsection{Be Bold}

\begin{frame}[fragile]
\frametitle{Bold}
\begin{block}{Bold Text}
We want \textbf{bold text}
\end{block}

\begin{verbatim}
We want \textbf{bold text}
\end{verbatim}
\end{frame}

\begin{frame}[fragile]
\frametitle{Emphasize!}
\begin{block}{Italic, Slanted, Emphasized Text}
We want \textit{italic text}, \textsl{slanted text}, \emph{emphasized text}
\end{block}

\begin{block}{Italic Text Source}
\begin{verbatim}
\textit{italic text},
\textsl{slanted text},
\emph{emphasized text}
\end{verbatim}
\end{block}
\end{frame}

\begin{frame}[fragile]
\frametitle{Bold}
\begin{block}{Bold Text}
\begin{flushleft}Left\end{flushleft}
\begin{center}Center\end{center}
\begin{flushright}Right\end{flushright}
\end{block}

\begin{verbatim}
\begin{flushleft} Left \end{flushleft}
\begin{center} Center \end{center}
\begin{flushright} Right \end{flushright}
\end{verbatim}
\end{frame}

\subsection{Lists and Tables}

\begin{frame}[fragile]
\frametitle{itemize}
\begin{block}{Title}
\begin{itemize}
\item item
\item item
\end{itemize}
\end{block}
\begin{block}{Title}
\begin{verbatim}
\begin{itemize}
\item item
\item item
\end{itemize}
\end{verbatim}
\end{block}
\end{frame}
\begin{frame}[fragile]
\frametitle{enumerate}
\begin{block}{Title}
\begin{enumerate}
\item item
\item item
\end{enumerate}
\end{block}
\begin{block}{Title}
\begin{verbatim}
\begin{enumerate}
\item item
\item item
\end{enumerate}
\end{verbatim}
\end{block}
\end{frame}

\begin{frame}
\frametitle{table}
\begin{block}{Title}
\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}
\end{block}
\end{frame}

\begin{frame}[fragile]
\frametitle{table source}
\begin{block}{Title}
\begin{verbatim}
\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular} \end{verbatim}
\end{block}
\end{frame}


\subsection{Formulas}

\begin{frame}[fragile]
\frametitle{Formulas}
\begin{block}{Formulas}
$ \int \frac{1-\cos x}{1 - \cos^2 x} dx
= \int \frac{1-\cos x}{\sin^2 x} dx
= \int \left( \frac{1}{\sin^2 x} - \frac{1}{\sin x \tan x} \right) dx$
\end{block}


\begin{block}{Matrix}
\begin{center}
$\begin{pmatrix}
9 & 8 & 6 \\
1 & 2 & 7 \\
4 & 9 & 2 \\
6 & 0 & 5
\end{pmatrix}$
\end{center}
\end{block}

\end{frame}

\begin{frame}[fragile]
\frametitle{Formula Source}
\begin{block}{Formula Source}
\begin{verbatim}
\int \frac{1-\cos x}{1 - \cos^2 x} dx
= \int \frac{1-\cos x}{\sin^2 x} dx
= \int \left( \frac{1}{\sin^2 x}
- \frac{1}{\sin x \tan x} \right) dx
\end{verbatim}
\end{block}

\begin{block}{Matrix Source}
\begin{verbatim}
\begin{pmatrix}
9 & 8 & 6 \\
1 & 2 & 7 \\
4 & 9 & 2 \\
6 & 0 & 5
\end{pmatrix}
\end{verbatim}
\end{block}
\end{frame}

\subsection{Graphics}
\begin{frame}[fragile]
\frametitle{Graphics}
\begin{block}{Graphics}
\center \includegraphics[width=2cm,height=2cm]{qrcode.png}
\end{block}

\begin{block}{Graphics Source}
\begin{verbatim}
\includegraphics[width=3cm,height=3cm]{qrcode.png}
\end{verbatim}
\end{block}
\end{frame}

\subsection{Beamer specific}

\begin{frame}[fragile]
\begin{block}{Appear Source}
\begin{verbatim}
\begin{itemize}
\item<2-> appears from slide 2 on
\item<2-4> appears from slide 2 to slide 4
\item<4> appears on slide 4
\item<3-> appears from slide 3 on
\end{itemize}
\end{verbatim}
\end{block}
\end{frame}

\begin{frame}[fragile]
\begin{block}{Appear}
\begin{itemize}
\item<2-> appears from slide 2 on
\item<2-4> appears from slide 2 to slide 4
\item<4> appears on slide 4
\item<3-> appears from slide 3 on
\end{itemize}
\end{block}
\end{frame}
\section{\LaTeX -for Pirates}

\subsection{The Templates}

\begin{frame}{Examples}
\begin{itemize}
\item bill.tex
\item letter.tex
\item article.tex
\item presentation.tex
\item report.tex
\end{itemize}
\end{frame}

\subsection{Set Language}

\begin{frame}[fragile]
\begin{block}{selectlanguage}
\begin{verbatim}
\selectlanguage{english}
\selectlanguage{french}
\selectlanguage{italian}
\selectlanguage{ngerman}
\end{verbatim}
\end{block}
\end{frame}

\subsection{Set Section}

\begin{frame}[fragile]
\begin{block}{usepackage ppsXX}
\begin{verbatim}
\usepackage{ppsag} % Aargau
\usepackage{ppsbb} % Beide Basel
\usepackage{ppsbe} % Bern / Berne
\end{verbatim}
\end{block}
\end{frame}

\section{\LaTeX -Problems}

\subsection{UTF8}

\begin{frame}{UTF8}
\begin{block}{UTF8}
Be sure to use an editor which understands UTF8, save text files as UTF8, Text-Encoding UTF8.
\end{block}
\end{frame}

\subsection{XeLaTex}

\begin{frame}{XeLaTex}
\begin{block}{XeLaTex}
Only if you use XeLaTeX to compile the tex file you will get the correct Aller Font.
\end{block}
\begin{block}
For TeXnicCenter users: you will have problems!
\end{block}
\end{frame}

\subsection{Fonts}

\begin{frame}{Fonts}
\begin{block}{Fonts}
Install the Aller Fonts. And don't forget to use xelatex command.
\end{block}
\begin{block}{TTL Fonts on Linux}
On Linux Machines: install the TTF fonts in your home directory or globally.
\end{block}
\end{frame}


\section{\LaTeX -amazing}

\subsection{Tic Tac Toe}

\begin{frame}
\frametitle{Tic-Tac-Toe via {\tt tabular}}
\setbeamercovered{invisible}
{\Huge
\begin{center}
\begin{tabular}{c|c|c}
\onslide<9->{O} & \onslide<8->{X} & \onslide<2->{X} \\ \hline
\onslide<6->{X} & \onslide<3->{O} & \onslide<5->{O} \\ \hline
\onslide<10->{X} & \onslide<7->{O} & \onslide<4->{X}
\end{tabular}
\end{center}
}
\end{frame}

\subsection{TikZ}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\begin{frame}
\frametitle{Prim's algorithm}

%% Adjacency matrix of graph
%% \ a b c d e f g
%% a x 7 5
%% b 7 x 8 9 7
%% c 8 x 5
%% d 5 9 x 15 6
%% e 7 5 15 x 8 9
%% f 6 8 x 11
%% g 9 11 x

\tikzstyle{vertex}=[circle,fill=black!25,minimum size=20pt,inner sep=0pt]
\tikzstyle{selected vertex} = [vertex, fill=red!24]
\tikzstyle{edge} = [draw,thick,-]
\tikzstyle{weight} = [font=\small]
\tikzstyle{selected edge} = [draw,line width=5pt,-,red!50]
\tikzstyle{ignored edge} = [draw,line width=5pt,-,black!20]

\begin{figure}
\begin{tikzpicture}[scale=1.8, auto,swap]
% Draw a 7,11 network
% First we draw the vertices
\foreach \pos/\name in {{(0,2)/a}, {(2,1)/b}, {(4,1)/c},
{(0,0)/d}, {(3,0)/e}, {(2,-1)/f}, {(4,-1)/g}}
\node[vertex] (\name) at \pos {$\name$};
% Connect vertices with edges and draw weights
\foreach \source/ \dest /\weight in {b/a/7, c/b/8,d/a/5,d/b/9,
e/b/7, e/c/5,e/d/15,
f/d/6,f/e/8,
g/e/9,g/f/11}
\path[edge] (\source) -- node[weight] {$\weight$} (\dest);
% Start animating the vertex and edge selection.
\foreach \vertex / \fr in {d/1,a/2,f/3,b/4,e/5,c/6,g/7}
\path<\fr-> node[selected vertex] at (\vertex) {$\vertex$};
% For convenience we use a background layer to highlight edges
% This way we don't have to worry about the highlighting covering
% weight labels.
\begin{pgfonlayer}{background}
\pause
\foreach \source / \dest in {d/a,d/f,a/b,b/e,e/c,e/g}
\path<+->[selected edge] (\source.center) -- (\dest.center);
\foreach \source / \dest / \fr in {d/b/4,d/e/5,e/f/5,b/c/6,f/g/7}
\path<\fr->[ignored edge] (\source.center) -- (\dest.center);
\end{pgfonlayer}
\end{tikzpicture}
\end{figure}

\end{frame}

\end{document}