% Heavily modified LaTeX code under non-commercial use as per license below.
% Elana Hashman, Slides July 2013
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This text is proprietary.                                                    %
% It's a part of presentation made by myself.                                  %
% It may not used commercial.                                                  %
% The noncommercial use such as private and study is free                      %
% Dec 2007                                                                     %
% Author: Sascha Frank                                                         %
% University Freiburg                                                          %
% www.informatik.uni-freiburg.de/~frank/                                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{beamer}
%% Handouts for printing
%\usepackage{pgfpages}
%\pgfpagesuselayout{4 on 1}[a4paper, landscape, border shrink=5mm]
%\pgfpageslogicalpageoptions{1}{border code=\pgfusepath{stroke}}
%\pgfpageslogicalpageoptions{2}{border code=\pgfusepath{stroke}}
%\pgfpageslogicalpageoptions{3}{border code=\pgfusepath{stroke}}
%\pgfpageslogicalpageoptions{4}{border code=\pgfusepath{stroke}}
\setbeamertemplate{navigation symbols}{}
\usetheme{Bergen}
\beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2->{15}}
\DeclareFontShape{OT1}{cmtt}{bx}{n}{
<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88>cmttb10}{}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{ragged2e}
\usepackage{alltt}
\usepackage{tikz}
\usepackage{coordsys}
\newcommand{\bs}{\symbol{92}}

\begin{document}
\title{Une introduction mathématique à \LaTeX\\[2mm]}
\subtitle{CUMC -- CC\'{E}M 2013, Montr\'{e}al, Qu\'{e}bec}  
\author{Elana Hashman\thanks{Traduction en français par David McLaughlin}}
\institute{\large University of Waterloo}
\date{July 13, 2013} 

%%% Title
\begin{frame}
\thispagestyle{empty}
\titlepage
\end{frame}

%%% ToC
\begin{frame}
\frametitle{Table des matières}
\tableofcontents
\end{frame} 


%%% History
\section{Introduction} 
\subsection{Histoire}
\begin{frame}\frametitle{Une brève histoire de \LaTeX} 
\TeX\ est presque certainement plus vieux que vous tous.\\[3mm]

\begin{itemize}
\item ``\TeX''\ à été développé par Don Knuth en 1978
\item Prononcée ``tech,'' du grecque \greektext teqnh\latintext\ 
\item Langage de balisage, comme HTML
\item \LaTeX\ à été dérivé de TeX par Leslie Lamport en 1985\\[3mm]
\item L’idée: Occupe toi du contenue du document et LaTeX s'occupera de la mise 
en page pour toi.
\end{itemize}
\end{frame}


%%% Software to use
\subsection{Installation}
\begin{frame} 
\frametitle{Obtenir le logiciel}
\LaTeX\ est un logiciel disponible gratuitement pour tous systèmes 
d'exploitations.\\[3mm]
\begin{itemize}
\item Le paquet {\tt pdflatex} pour plateformes OS X/UNIX
\item LyX, un logiciel type WYSIWYG: \url{http://www.lyx.org}
\item Enligne: \url{http://scribtex.com}
\end{itemize}
\end{frame}


%%% My first document
\subsection{Mon premier document}
\begin{frame}\frametitle{Mon premier document}
\framebox[3.55in]{\textrm{ Hello, world!}}
\end{frame}


%%% Code
\section{Structure du code}
\begin{frame}[fragile]
\frametitle{Code pour mon premier document}
Code \LaTeX:
{\small \begin{verbatim}
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
\end{verbatim}}
\pause
\vspace{5mm}

Contraste avec un document HTML similaire:
{\small \begin{verbatim}
<html>
   <body>
      Hello, world!
   </body>
</html>
\end{verbatim}}
\end{frame}


%%% Layout
\subsection{Structure du fichier}
\begin{frame}
\frametitle{Structure du fichier}
\begin{enumerate}
\item Type de document\\
{\small {\tt $\circ$ article}\\
{\tt $\circ$ beamer} («slides»)\\
{\tt $\circ$ report}}\\[4mm]\pause
\item Préambule (entête)\\
{\small $\circ$ Inclure les paquets\\
$\circ$  Fixer l’espacement\\[0mm]
$\circ$  Déclarer les macros et les commandes}\\\pause
\item Corps (contenu)
\end{enumerate}
\end{frame}


%%% Template samples
\subsection{Modèles}
\begin{frame}
\frametitle{Modèles exemple}
Voici quelques modèles et de l'information sur les préambules que vous pouvez 
utiliser.\\[5mm]
\url{http://hashman.ca/tex} pour\\
\begin{itemize}
\item {\tt article.tex}, 
\item {\tt report.tex}, et
\item {\tt slides.tex} 
\end{itemize}
modèles exemple.
\end{frame}


%%% Proof and code
\subsection{Preuve par example}
\begin{frame}
\frametitle{\tt \textbackslash begin\{document\} }
{\bf Squeeze Theorem.}\\[1mm]
{\justifying Let $(x_n)$, $(y_n)$ and $(z_n)$ be sequences in $\mathbb{R}$.  
Suppose $(x_n)\to L$, $(z_n)\to L$, and for all $n \ge n_0$, we have $x_n \le 
y_n \le z_n$; then $(y_n)\to L$.\\[1mm]\pause
\begin{proof}
Let $\varepsilon > 0$. Since $(x_n)\to L$, there is some integer $n_1$ such 
that $\forall\ n \ge n_1$, we have $|x_n - L| < \varepsilon$.\\[2mm]

Similarly, for the same $\varepsilon$, since $(z_n)$ converges, $\exists\ n_2 
\in \mathbb{N}$ such that $\forall\ n \ge n_2$, we have $|z_n - L| < 
\varepsilon$.\\[2mm]

Then take $N = \max(n_0, n_1, n_2)$, and let $n \ge N$. For all $n \ge N$, we 
must have
\[ L-\varepsilon < x_n \le y_n \le z_n < L+\varepsilon \]
which implies $|y_n - L| < \varepsilon$. So $(y_n)$ converges to $L$.
\end{proof}
}
\end{frame}


\begin{frame}[fragile]
\frametitle{Squeeze Theorem Code, I}
\begin{alltt}
\{\emph{{\bs}bf} Squeeze Theorem.\}

Let \textbf{$(x_n)$}, \textbf{$(y_n)$} and \textbf{$(z_n)$} be 
sequences in \textbf{$\emph{{\bs}mathbb}\{R\}$}.

Suppose \textbf{$(x_n) \emph{{\bs}to} L$}, \textbf{$(z_n) \emph{{\bs}to} L$}, 
and for all \textbf{$n \emph{{\bs}ge} n_0$}, we have \textbf{$x_n 
\emph{{\bs}le} y_n \emph{{\bs}le} z_n$}; then \textbf{$(y_n) \emph{{\bs}to} 
L$}.

\end{alltt}
\end{frame}


\begin{frame}[fragile]
\frametitle{Squeeze Theorem Code, II}
\begin{alltt}
\emph{{\bs}begin}\{proof\}
Let \textbf{$\emph{{\bs}epsilon} > 0$}. Since \textbf{$(x_n)\emph{{\bs}to} L$}, 
there is some integer \textbf{$n_1$} such that 
\textbf{$\emph{{\bs}forall} n \emph{{\bs}ge} n_1$}, we have 
\textbf{$|x_n - L| < \emph{{\bs}epsilon}$}.\bs\bs[2mm]

Similarly, for the same \textbf{$\emph{{\bs}epsilon}$}, since 
\textbf{$(z_n)$} converges, \textbf{$\emph{{\bs}exists} n_2 \emph{{\bs}in} 
\emph{{\bs}mathbb}\{N\}$} such that \textbf{$\emph{{\bs}forall} n \emph{{\bs}ge}
n_2$}, we have \textbf{$|z_n - L| < \emph{{\bs}epsilon}$}.\bs\bs[2mm]
\end{alltt}
\end{frame}


\begin{frame}[fragile]
\frametitle{Squeeze Theorem Code, III}
\begin{alltt}
Then take \textbf{$N = \emph{{\bs}max}(n_0, n_1, n_2)$}, 
and let \textbf{$n \emph{{\bs}ge} N$}. For all \textbf{$n \emph{{\bs}ge} N$}, 
we must have

\textbf{\bs[ L - \emph{{\bs}epsilon} < x_n 
              \emph{{\bs}le} y_n 
              \emph{{\bs}le} z_n < L + \emph{{\bs}epsilon} \bs]}

which implies \textbf{$|y_n - L| < \emph{{\bs}epsilon}$}. 
So \textbf{$(y_n)$} converges to \textbf{$L$}.
\emph{{\bs}end}\{proof\}

\end{alltt}
\end{frame}


%%% Terminology
\begin{frame}
\frametitle{Terminologie}
\begin{itemize}
\item {\bf Caractère de contrôle:} \textbf{\tt \$ \% \# \& \^ \_ \{ \}}, etc.  
\pause
\item {\bf Commande:} séquence commencent par {\tt `\bs'}, e.g. {\tt {\bs}bf} 
ou {\tt {\bs}mathbb\{R\}} \pause
\item {\bf Environnement:} sections délimitées par des commandes avec des 
propriétés spéciales, e.g.  {\tt {\bs}begin\{proof\}} et {\tt 
{\bs}end\{proof\}} \pause
\item {\bf Mode math:} délimitées par \$
\end{itemize}
\end{frame}


%%% Things to know for math mode
\begin{frame}[fragile]
\frametitle{Commandes courantes en mode math}
\begin{center}
\begin{tabular}{cc}
\hline~\\[-3mm]
\textbf{Display} & \textbf{\LaTeX\ code}\\[1mm]\hline\hline ~\\[-3mm]
$x^{i+1}$ & \verb|x^{i+1}| ~\\[1mm]\hline\\[-3mm]
   $\frac{1}{2}$ & \verb|\frac{1}{2}| ~\\[1mm]\hline\\[-3mm]
$\quad \sqrt{b^2-4ac}\quad\ $ & \verb|\sqrt{b^2-4ac}| ~\\[1mm]\hline\\[-3mm]
   $\ln{e}$ & \verb|\ln{e}| ~\\[1mm]\hline\\[-2mm]
$\displaystyle\lim_{n\to\infty} (x_n)$ & \verb|\lim_{n\to\infty} (x_n)| 
~\\[2mm]\hline\\[-3mm]
$\cos{(2{\pi}n)}$ & \verb|\cos{(2{\pi}n)}|~\\[1mm]\hline\\[-3mm]
$\displaystyle\sum_{i=1}^n s_ib_i$ & \verb|\sum_{i=1}^n s_i b_i|~\\[5mm]\hline
\end{tabular}
\end{center}
\end{frame}

\begin{frame}[fragile]
\frametitle{Commandes courantes en mode math (suite)}
\begin{center}
\begin{tabular}{cc}
\hline~\\[-3mm]
\textbf{Display} & \textbf{\LaTeX\ code}\\[1mm]\hline\hline ~\\[-3mm]
$10 \equiv 3 \pmod{7}$ & \verb|10 \equiv 3 \pmod{7}| ~\\[1mm]\hline\\[-3mm]
$\displaystyle\int_a^b f(x)\,dx$ & \verb|\int_a^b f(x)\,dx| ~\\[4mm]\hline\\[-3mm]
$\mathcal{P}$ & \verb|\mathcal{P}| ~\\[1mm]\hline\\[-3mm]
$\tau\ \varepsilon\ \chi$ & \verb|\tau \epsilon \chi| ~\\[1mm]\hline\\[-2mm]
$A \cap B \ne \varnothing$ & \verb|A \cap B \ne \varnothing|~\\[1mm]\hline\\[-3mm]
$\beta = \{v_1, \ldots, v_n\}$ & \verb|\beta = \{v_1, \ldots, v_n\}|~\\[1mm]\hline\\[-3mm]
$f\colon S \to \mathbb{R}$ & \verb|f \colon S \to \mathbb{R}|~\\[1mm]\hline\\[-3mm]
\end{tabular}
\end{center}

\end{frame}


%%% TeX experts bits
\section{Pour les experts en \TeX}
\subsection{Quelques trucs pratiques}
\begin{frame}
\frametitle{Trucs pour les experts en \LaTeX !}

\begin{block}{\small À NE PAS FAIRE}
\begin{itemize}
\item \small N'utilisez pas l’environnement {\tt array} pour des matrices. Plutôt 
utilisez l'environnement {\tt matrix}.
\item \small N'oubliez pas les commandes {\tt `*'}.
\item \small Ne laissez pas les autres vous dires que vous utilisez \LaTeX\ « 
mal ».
\item \small N'ayez pas peur d’écrire des macros pour raccourcir votre 
document.\\[1mm]
\end{itemize}
\end{block}
\begin{block}{\small À FAIRE}
\begin{itemize}
\item \small Utilisez un bon éditeur de texte.
\item \small Soyez patients pour apprendre. C'est dur sur le coup, mais à la 
longue, vous allez commencer à vous améliorer rapidement.  \item \small 
Utilisez Google (ou autre engin de recherche). C'est votre ami.
\item \small Utilisez \LaTeX\ pour vos devoirs. Plus votre devoir est lisible, 
plus le marqueur sera tolérant!
\end{itemize}
\end{block}
\end{frame}


\subsection{Macros et environnements personnalisés}
\begin{frame}[fragile]
\frametitle{Macros et autres objets définis par l'utilisateur}
\begin{itemize}
\item $\mathbb{R}$: {\tt{\bs}mathbb\{R\}} vs. {\tt{\bs}R}
\item $\operatorname{dim}(V)$: {\tt{\bs}operatorname\{dim\}} vs. {\tt{\bs}dim}
\item $\overline{\int}_P(e^x)$: {\tt{\bs}overline\{{\bs}int\}} 
vs.  {\tt{\bs}uint}
\item $\subseteq$: {\tt{\bs}subseteq} vs. {\tt{\bs}ss}\\[3mm]
\item Centrer dans l’environnement {\tt enumerate} sans bouger les nombres.\\[3mm]
\item Conteurs pour questions\\[3mm]
\item Générer facilement une table des matières, page titre, etc.\\[3mm]
\end{itemize}

Plus d'information à ce sujet peux être trouver dans {\tt macros.sty} sur mon 
site web.
\end{frame}

\subsection{Graphiques}
\begin{frame}
\frametitle{TiKZ et autres paquet pour graphiques}
\vspace{-0.1in}
\begin{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This file is part of the book
%%
%% Algorithmic Graph Theory
%% http://code.google.com/p/graph-theory-algorithms-book/
%%
%% Copyright (C) 2009--2011 Minh Van Nguyen <nguyenminh2@gmail.com>
%%
%% See the file COPYING for copying conditions.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%% from http://code.google.com/r/isabelindarj-graph/source/browse/image/distance-connectivity/petersen-graph.tex?r=6b8618b651eb5af51b726d688de6acad9ff931a1
%% Copying permitted under the GPL v1.3.
\begin{block}{Graphes}
\begin{tikzpicture}
[nodeDecorate/.style={shape=circle,inner sep=2pt,draw,thick},%
  lineDecorate/.style={-,thick},scale=1.5]
%% nodes or vertices
\foreach \nodename/\x/\y in {
  %% outer pentagon
  0/0/2, 1/-1.9021/0.6180, 2/-1.1755/-1.6180, 3/1.1755/-1.6180,
  4/1.9021/0.6180,
  %% inner pentagon
  5/0/1, 6/-0.9510/0.3090, 7/-0.5877/-0.8090, 8/0.5877/-0.8090,
  9/0.9510/0.3090}
{
  \node (\nodename) at (\x,\y) [nodeDecorate] {};
}
%% edges or lines
\path
\foreach \startnode/\endnode in {0/1, 0/4, 0/5, 1/2, 1/6, 2/3, 2/7,
  3/4, 3/8, 4/9, 5/7, 5/8, 6/8, 6/9, 7/9}
{
  (\startnode) edge[lineDecorate] node {} (\endnode)
};
\end{tikzpicture}
\end{block}
$\phantom{x}$\\

\begin{block}{Diagrammes}
%%% Authored by yours truly
\vspace{0.25in}
\begin{picture}(200,0)
\put(100,0){\vector(1,0){75}}
\put(100,0){\vector(-1,0){75}}
\put(100,-3){\line(0,1){6}}
\put(150,-3){\line(0,1){6}}
\put(50,-3){\line(0,1){6}}
\put(100,-15){\makebox(0,0)[b]{$b$}}
\put(150,-15){\makebox(0,0)[b]{$b+r$}}
\put(50,-15){\makebox(0,0)[b]{$b-r$}}
\put(50,5){$\overbrace{\rule{35mm}{0mm}}$}
\put(100,17){\makebox(0,0){$a$}}
\end{picture}
\end{block}
\end{center}
\end{frame}


%%% Conclusion
\section{Questions}

\begin{frame}[fragile]
\frametitle{End!}
{\bf Plus de ressources:}

\begin{itemize}
\item Mon site web:\\ {\small \url{http://hashman.ca/tex}}
\item Wikibooks' \LaTeX\ guide: {\small 
\url{http://en.wikibooks.org/wiki/LaTeX}}
\item David Wilkins' Primer: {\small
\url{http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/}}
\item N'importe quel étudiant à la maîtrise ou au doctorat, surtout lorsque 
leurs thèse les tracasse
\end{itemize}
\end{frame}

\end{document}
