\usepackage{tikz}
\usepackage{cooltooltips}
\usepackage{xmpmulti}
\usepackage{parallel}
\usepackage{cmap}

\usepackage{csed}

\usetikzlibrary{shapes}

\newcommand*{\dq}[1]{``#1''}

\title{An Introduction to \LaTeX}
\author{Nicola L. C. Talbot}
\date{24th February \& 3rd March 2010}
\institute{University of East Anglia}

\begin{document}
\begin{frame}
  \titlepage
\end{frame}
\maketitle

\section<presentation>*{Outline}
\begin{frame}<presentation>
\tableofcontents[hideallsubsections,pausesections]
\end{frame}

\section{Introduction}
\subsection{Overview}

\begin{frame}
  \frametitle{What are \TeX\ and \LaTeX?}

  \begin{itemize}
    \item<+-> \TeX\ is a typesetting application.

    \item<+-> It uses \term{primitives} to determine how to put
          text on a page.

    \item<+-> Very complicated!

    \item<+-> \term{Formats} are provided that translate easy to use
          commands into the low level primitives required by \TeX.

    \begin{itemize}
       \item<+-> Plain \TeX
       \item<+-|alert@6-> \LaTeX
       \item<+-> ConTeXt
       \item<+-> \ldots
    \end{itemize}
   \item<+-> Think of \LaTeX\ as an interpreter between you and \TeX.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{What Else is There?}

  \begin{description}
  \item[XeTeX/XeLaTeX:] based on a merger of \TeX\ and modern
  font technologies.

  \begin{itemize} 
    \item Supports Unicode character sets.

    \item Supports bidirectional typesetting.
  \end{itemize}

  \item[LuaTeX:] \TeX-like engine with a lua interpreter built in.
  \end{description}
\end{frame}

\begin{frame}
  \frametitle{What do we need to use \LaTeX?}

  \begin{itemize}[<+->]
    \item A text editor (e.g.\ notepad).
    \item A PDF viewer (e.g.\ Adobe Reader).
    \item A \TeX\ distribution (e.g\ MiKTeX or TeX Live).
  \end{itemize}
\end{frame}

(Notepad isn't a particularly good editor. It's much better to
use an editor that's \TeX-aware.)

\begin{frame}
  \frametitle{Workflow}

\small\mode<article>{\footnotesize}
  \resizebox{\linewidth}{!}{%
  \begin{tikzpicture}[minimum width=1.5cm,minimum height=1.5cm,inner sep=.1em,thick]
  \path (0,0) node[draw] (edit) {\shortstack{Edit\\.tex\\File}};
  \uncover<2->{\path (2.5,0) node[draw,diamond] (errors) {\shortstack{Any\\Errors?}};}
  \uncover<4->{\path (5,0) node[draw] (pdf) {\shortstack{View\\PDF}};}
  \uncover<5->{\path (7.5,0) node[draw,diamond] (change) {\shortstack{Any\\Changes?}};}
  \uncover<7->{\path (10,0) node[draw] (done) {Done};}
  \uncover<2->{\draw[->] (edit) -- (errors) node[midway,above=-1em] {\LaTeX};}
  \uncover<3->{\draw[->] (errors) -- ++(0,-2) node[midway,right=-1em] {Yes} -| (edit);}
  \uncover<4->{\draw[->] (errors) -- (pdf) node[midway,above=-1em] {No};}
  \uncover<5->{\draw[->] (pdf) -- (change);}
  \uncover<6->{\draw[->] (change) -- ++(0,-2.5) node[midway,right=-1em] {Yes} -| (edit);}
  \uncover<7->{\draw[->] (change) -- (done) node[midway,above=-1em] {No};}
  \end{tikzpicture}}

\end{frame}

\mode<presentation>
{
\ifshowanimation
  \begin{frame}
    \frametitle{Example}

    \animate<2-203>
    \centering

    \begin{tikzpicture}
     \path<1-66> (0,0) node (backdrop) {\pgfuseimage{backdrop}};
     \clip (backdrop.south west) rectangle (backdrop.north east);
     \path<1> (0,0) node (pointer) {\pgfuseimage{pointer}};
% Move pointer to the start menu
     \foreach \x in {2,...,24}
       {\path<\x>[x={(2mm,0mm)},y={(0mm,1.3mm)}] ++(-\x,-\x) node (pointer) {\pgfuseimage{pointer}};}
     \path<25-27> (backdrop.south west) node[anchor=south west] (startmenu) {\pgfuseimage{startmenu}};
% Move pointer up the start menu
     \foreach \x in {25,...,27}
       {\path<\x>[y={(0mm,3mm)}] (backdrop.south west) ++(0,\x) ++(4mm,-24) node (pointer) {\pgfuseimage{pointer}};}
     \path<28-45> (backdrop.south west) node[anchor=south west] (programsmenu) {\pgfuseimage{programsmenu}};
% Move the pointer over to the programs menu
     \foreach \x in {28,...,32}
       {
         \path<\x>[x={(3.8mm,0mm)}] (backdrop.south west) ++(\x, 12mm) ++(-26,0)node (pointer) {\pgfuseimage{pointer}};
       }
% Move the pointer up the programs menu
     \foreach \x in {33,...,44}
       {
         \path<\x>[y={(0mm,3mm)}] (backdrop.south west) ++(24mm, \x) ++(0,-26.5) node (pointer) {\pgfuseimage{pointer}};
       }
     \path<45-53> (backdrop.south west) node[anchor=south west] (submenu) {\pgfuseimage{submenu}};
% Move the pointer over to the submenu
     \foreach \x in {45,...,50}
       {
         \path<\x>[x={(3mm,0mm)}] (backdrop.south west) ++(\x,55mm) ++(-37,0) node (pointer) {\pgfuseimage{pointer}};
       }
% Move pointer down submenu
     \foreach \x in {51,...,53}
       {
         \path<\x>[y={(0mm,1mm)}] (backdrop.south west) ++(40mm,-\x) ++(0,106) node (pointer) {\pgfuseimage{pointer}};
       }
     \path<54-62> (backdrop.south west) node[anchor=south west] (latexmenu) {\pgfuseimage{latexmenu}};
     \path<63-64> (backdrop.south west) node[anchor=south west] (latexmenu2) {\pgfuseimage{latexmenu2}};
% Move pointer across to LaTeX menu
     \foreach \x in {54,...,62}
       {
         \path<\x>[x={(2mm,0mm)}] (backdrop.south west) ++(\x,53mm) ++(-34,0) node (pointer) {\pgfuseimage{pointer}};
       }
% Move pointer down LaTeX menu
     \foreach \x in {63,...,64}
       {
         \path<\x>[y={(0mm,1mm)}] (backdrop.south west) ++(56mm,-\x) ++(0,115) node (pointer) {\pgfuseimage{pointer}};
       }
     \path<65> (backdrop.north west) node[anchor=north west] (cmd1) {\pgfuseimage{cmd1}};
     \path<66> (backdrop.north west) node[anchor=north west] (cmd2) {\pgfuseimage{cmd2}};
     \path<67-79> (0,0) node (texmaker) {\pgfuseimage{tmkwin1}};
     \path<80> (0,0) node (texmaker) {\pgfuseimage{tmkwin2}};
% Move pointer to New button
     \foreach \x in {67,...,80}
       {
         \path<\x>[x={(3.3mm,0mm)},y={(0mm,2mm)}] (67,-67) ++(-\x,\x) node (pointer) {\pgfuseimage{pointer}};
       }
     \path<81-84> (0,0) node (texmaker) {\pgfuseimage{tmkwin3}};
% Move pointer to Wizard menu
     \foreach \x in {81,...,84}
       {
         \path<\x>[x={(4mm,0mm)},y={(0mm,0.5mm)}] (-91,-26) ++(\x,\x) node (pointer) {\pgfuseimage{pointer}};
       }
     \path<85> (0,0) node (texmaker) {\pgfuseimage{tmkwin4}};
     \path<85> (-28mm,29mm) node (pointer) {\pgfuseimage{pointer}};
     \path<86> (0,0) node (texmaker) {\pgfuseimage{tmkwin5}};
     \path<86> (-27mm,27mm) node (pointer) {\pgfuseimage{pointer}};
     \path<87-102> (0,0) node (texmaker) {\pgfuseimage{tmkwin6}};
% Move pointer to typeface size
     \foreach \x in {87,...,94}
       {
         \path<\x>[x={(3mm,0mm)},y={(0mm,-2mm)}] (-95,-101) ++(\x,\x) node (pointer) {\pgfuseimage{pointer}};
       }
     \foreach \x in {95,...,102}
       {
         \path<\x>[x={(2mm,0mm)},y={(0mm,1mm)}] (-95,13) ++(\x,0) node (pointer) {\pgfuseimage{pointer}};
       }
% Select typeface size
     \path<103> (0,0) node (texmaker) {\pgfuseimage{tmkwin7}};
     \path<103> (14mm,13mm) node (pointer) {\pgfuseimage{pointer}};
     \path<104> (0,0) node (texmaker) {\pgfuseimage{tmkwin8}};
     \path<104> (14mm,11mm) node (pointer) {\pgfuseimage{pointer}};
     \path<105> (0,0) node (texmaker) {\pgfuseimage{tmkwin9}};
     \path<105> (14mm,9mm) node (pointer) {\pgfuseimage{pointer}};
     \path<106-107> (0,0) node (texmaker) {\pgfuseimage{tmkwin10}};
     \path<106> (14mm,9mm) node (pointer) {\pgfuseimage{pointer}};
% Move to encoding
     \path<108-109> (0,0) node (texmaker) {\pgfuseimage{tmkwin11}};
     \path<107-108> (14mm,8mm) node (pointer) {\pgfuseimage{pointer}};
     \path<109> (12mm,7mm) node (pointer) {\pgfuseimage{pointer}};
     \path<110> (0,0) node (texmaker) {\pgfuseimage{tmkwin12}};
     \path<110> (12mm,5.5mm) node (pointer) {\pgfuseimage{pointer}};
     \path<111> (0,0) node (texmaker) {\pgfuseimage{tmkwin13}};
     \path<111> (12mm,4.5mm) node (pointer) {\pgfuseimage{pointer}};
     \path<112> (0,0) node (texmaker) {\pgfuseimage{tmkwin14}};
     \path<112> (12mm,3.5mm) node (pointer) {\pgfuseimage{pointer}};
     \foreach \x/\y in {113/15,114/16,115/17,116/18,117/19,118/20,119/21,120/22,121/23,122/24,123/25,124/26,125/27,126/28,127/29,128/30,129/31,130/32,131/33,132/34,132/35}
     {
       \path<\x> (0,0) node (texmaker) {\pgfuseimage{tmkwin\y}};
     }
% Move to select word
     \path<132-144> (0,0) node (texmaker) {\pgfuseimage{tmkwin36}};
     \path<113-132> (12mm,2.5mm) node (pointer) {\pgfuseimage{pointer}};
     \foreach \x in {133,...,144}
     {
       \path<\x>[x={(-2mm,0mm)},y={(0mm,1.2mm)}] (-6,2.08) ++(-133,-133) ++(\x,\x) node (pointer) {\pgfuseimage{pointer}};
     }
     \path<145> (0,0) node (texmaker) {\pgfuseimage{tmkwin37}};
     \path<146-158> (0,0) node (texmaker) {\pgfuseimage{tmkwin38}};
     \path<145-146> (-10mm,15.7mm) node (pointer) {\pgfuseimage{pointer}};
% Move to LaTeX menu
     \foreach \x in {147,...,158}
     {
       \path<\x>[x={(-2mm,0mm)},y={(0mm,1.2mm)}] (-142,-133.9) ++(\x,\x) node (pointer) {\pgfuseimage{pointer}};
     }
     \path<159-168> (0,0) node (texmaker) {\pgfuseimage{tmkwin39}};
     \path<159> (-32mm,28.92mm) node (pointer) {\pgfuseimage{pointer}};
     \path<169-181> (0,0) node (texmaker) {\pgfuseimage{tmkwin40}};
% Move down LaTeX menu
     \foreach \x in {160,...,169}
     {
       \path<\x>[x={(1mm,0mm)},y={(0mm,-2mm)}] (-32,-14) ++(0,-160) ++(0,\x) node (pointer) {\pgfuseimage{pointer}};
     }
% Move across to font styles sub menu
     \foreach \x in {170,...,176}
     {
       \path<\x>[x={(2mm,0mm)},y={(0mm,1mm)}] (-186,10) ++(\x,0) node (pointer) {\pgfuseimage{pointer}};
     }
% Move down
     \path<182> (0,0) node (texmaker) {\pgfuseimage{tmkwin41}};
     \foreach \x in {177,...,182}
     {
       \path<\x>[x={(1mm,0mm)},y={(0mm,-2mm)}] (-20,-5) ++(0,-177) ++(0,\x) node (pointer) {\pgfuseimage{pointer}};
     }
     \path<183-191> (0,0) node (texmaker) {\pgfuseimage{tmkwin42}};
     \path<192> (0,0) node (texmaker) {\pgfuseimage{tmkwin43}};
% Move to save button
     \foreach \x in {183,...,192}
     {
       \path<\x>[x={(-2mm,0mm)},y={(0mm,3mm)}] (10,0) ++(-183,-183) ++(\x,\x) node (pointer) {\pgfuseimage{pointer}};
     }
     \path<193-197> (0,0) node (saveas) {\pgfuseimage{saveAs1}};
     \foreach \x in {193,...,197}
     {
       \path<\x>[x={(1mm,0mm)},y={(0mm,-2mm)}] (-37,0) ++(0,-193) ++(0,\x) node (pointer) {\pgfuseimage{pointer}};
     }
     \foreach \x/\y in {198/2,199/3,200/4,201/5,202/6}
     {
        \path<\x> (0,0) node (saveas) {\pgfuseimage{saveAs\y}};
     }
     \path<203> (0,0) node (texmaker) {\pgfuseimage{tmkwin44}};
     \path<204> (0,0) node (texmaker) {\pgfuseimage{tmkwin45}};
     \path<203-204> (3mm,26mm) node (pointer) {\pgfuseimage{pointer}};
     \path<205> (0,0) node (texmaker) {\pgfuseimage{tmkwin46}};
    \end{tikzpicture}

  \end{frame}
\fi
}

\begin{frame}
  \frametitle{Installation}
\setlength{\fboxrule}{-1pt}% Suppress frame around tooltip

  \begin{itemize}[<+->]
     \item DVD ROM (easiest method):
     \begin{itemize}
        \item Available free to members of the \TeX\
              User Group (\cooltooltip{TUG Membership}{Early bird 
              membership USD 85. After 31 March 2010, USD 95. Visit 
              http://www.tug.org/join.html to join.}%
              {http://www.tug.org/join.html}{Visit TUG}{TUG}) or 
              local groups such as the UK \TeX\ User Group 
              (\cooltooltip{UKTUG Membership}{New membership for 
              2010 cost GBP 10. Visit http://uk.tug.org/Membership/ 
              to join.}{http://uk.tug.org/Membership/}{Visit 
              UKTUG}{UKTUG}).

\mode<article>{UKTUG: new membership for 2010 costs \pounds10. Visit 
\url{http://uk.tug.org/Membership/} to join. TUG: early bird
membership is \$85. After 31st March 2010, \$95. Visit
\url{http://www.tug.org/join.html} to join.}


        \item Can be purchased from \url{http://www.tug.org/store/}
     \end{itemize}
     \item Download it from the Internet: \url{http://www.tug.org/}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Text Editors Available for Windows}

  \begin{center}
    \begin{tabular}{lcl}
    TeXMaker & Free & \url{http://www.xm1math.net/texmaker/}\\
    TeXnicCenter & Free & \url{http://www.texniccenter.org/}\\
    WinEdt & Shareware & \url{http://www.winedt.com/}\\
    WinShell & Free & \url{http://www.winshell.org/}
    \end{tabular}
  \end{center}

  We will be using TeXMaker.
\end{frame}

\begin{frame}
  \frametitle{Warning!}

  \begin{itemize}[<+->]
    \item Word processors can instill bad typographical habits.
          Examples:

      \begin{itemize}
        \item Fully justifying text without hyphenation\dash this
              can produce large areas of white space between words.

        \item No paragraph indentation and blank lines between 
              paragraphs. (This is becoming more accepted, especially
              for HTML documents, but it's still considered 
              amateurish by some.)
      \end{itemize}

    \item \TeX\ follows many typesetting rules.

    \item People changing from word processors to \TeX\ often get
          frustrated because \TeX\ makes it difficult (but not
          impossible) to implement these bad habits.
  \end{itemize}
\end{frame}

\subsection{Getting Started}

\begin{frame}[fragile]
  \frametitle{Special Characters}

  \begin{itemize}[<+->]
    \item With a word processor, you can type any symbol on your
    keyboard.
    \item \TeX\ has \term{special characters}. These are symbols
    that have a special meaning and should be used with care!

    \begin{center}
      \verb|\| \verb|{| \verb|}| \verb|%| \verb|~| \verb|&|
      \verb|#| \verb|$| \verb|^| \verb|_|
    \end{center}

    \item If you actually want to produce one of those symbols,
          you need to use a command:

    \begin{center}
\cs{textbackslash} \verb|\{| \verb|\}| \verb|\%| \cs{textasciitilde}
\verb|\&| \verb|\#| \verb|\$| \cs{textasciicircum} \verb|\_|
    \end{center}

  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Spaces}

  \begin{itemize}[<+->]
    \item \TeX\ treats multiple spaces as a single space.
    \item By default, the space between sentences is slightly larger
          than the space between words. This can be switched off
          using \cs{frenchspacing}.
    \item New line characters are treated as a space.
    \item Paragraph breaks should be indicated by a blank line. (By
          default, there won't be a blank line in the PDF file.)
    \item \LaTeX\ automatically indents paragraphs, except for the
          first paragraph after a section heading.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{A Simple Document}

  \begin{example}
\begin{semiverbatim}
\textcolor<2>{Red}{\cs{documentclass}\annote<5-7>[offset=0.5in,voffset=1cm,pos=br,bg=highlight2]{[a4paper,12pt]}{Class options}\annote<4-7>[pos=br,bg=highlight1]{\marg{article}}{The class name.}}
\vspace{-2\baselineskip}\alt<7>{\colorbox{highlight4}{\rmfamily Preamble}}{\strut}
\textcolor<2>{Red}{\cs{begin}\marg{document}}
\textcolor<3>{Blue}{\% This is a comment}
\annote<6-7>[pos=cr,bg=highlight3,offset=0.4in]{\begin{tabular}{@{}l}
This is   a simple\\
document\cs{footnote}\marg{with a footnote}.\\
\\
This is a new paragraph.
\end{tabular}}{The document.}
\textcolor<2>{Red}{\cs{end}\marg{document}}
\end{semiverbatim}
  \end{example}

  \begin{exercise}<8->
  Create the above document.
\mode<article>{To get started, do:
\begin{enumerate}
\item \menu{Start}\menuitem{Programs}\menuitem{CMP Development Tools}\menuitem{LaTeX\menuitem{TeXMaker GUI}}
\item A command prompt will appear. Wait for it to go away.
\item In TeXMaker, select \menu{File}\menuitem{New} (or click
the \dq{New} button.)
\item Select \menu{Wizard}\menuitem{Quick Start}.
\item Select \texttt{12pt} and \texttt{a4paper} and click \dq{Okay}
\item Type in the above code.
\item Save the document (e.g.\ call it \texttt{exercise.tex}).
\item Select \menu{Tools}\menuitem{PDFLaTeX}.
\item Check the messages in the lower right hand box.
\item If there are no errors, start up Adobe Reader and load the new PDF file.
\end{enumerate}}
  \end{exercise}
\end{frame}

\section{Classes and Packages}

\subsection{Document Classes}

\begin{frame}
  \frametitle{Document Classes}

  \begin{itemize}[<+->]
    \item The \term{document class} sets up the general layout
          of the document. For example:

     \begin{itemize}
       \item the format of the headings;
       \item if the document should have chapters;
       \item if the title should be on a separate page or above 
             the text on the first page.
     \end{itemize}

    \item The class is specified using
    \begin{cmddef}
      \cs{documentclass}\oarg{\meta{options}}\marg{\meta{class-name}}
    \end{cmddef}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Available Classes}

  \begin{itemize}[<+->]
    \item There are many classes available for different types of
          documents.

    \item Basic classes:

    \begin{description}
      \item[\cls{article}] for short documents without chapters;
      \item[\cls{report}] for longer documents with chapters,
        typically single-sided with an abstract;
      \item[\cls{book}] for books, typically double-sided with
        front matter and back matter;
      \item[\cls{letter}] for correspondence;
      \item[\cls{slides}] for presentations.
    \end{description}

    \item The basic classes aren't very flexible.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Modern Classes}

  \begin{itemize}
    \item The KOMA-Script classes:
    \begin{itemize}
      \item \cls{scrartcl} replaces \cls{article}
      \item \cls{scrreprt} replaces \cls{report}
      \item \cls{scrbook} replaces \cls{book}
      \item \cls{scrlttr2} replaces \cls{letter}
    \end{itemize}

    \item<2-> \cls{memoir} replaces \cls{book} and \cls{report}

    \item<3-> \cls{octavo} replaces \cls{book}

    \item<4-> Presentations (replacing \cls{slides}):
    \begin{itemize}
      \item \cls{beamer} (used to create \alt<article>{the accompanying slides}{this document})
      \item \cls{prosper}
      \item \cls{foils}
    \end{itemize}

    \item<5-> We will be using \cls{scrartcl} for the rest of the
              exercises.
  \end{itemize}
\end{frame}

\subsection{Packages}

\begin{frame}[fragile]
  \frametitle{Packages}

  \begin{itemize}
    \item<1-> A \term{package} is a type of \dq{add-on} or 
              \dq{plugin}.

    \item<2-> Packages are loaded (in the preamble) using:
    \begin{cmddef}
    \cs{usepackage}\oarg{\meta{options}}\marg{\meta{package-name}}
    \end{cmddef}

  \end{itemize}

\begin{example}<3->
\begin{semiverbatim}
\cs{documentclass}\marg{scrartcl}
\annote<4->[pos=cr,bg=highlight1]{\cs{usepackage}\marg{hieroglf}}{provides \cs{textpmhg}}

\cs{begin}\marg{document}
\vspace{-\baselineskip}Some hieroglyphics: \annote<5->[pos=cr,bg=highlight2]{\cs{textpmhg}\marg{Ra}}{Needs \sty{hieroglf}\\package\\to work}
\vspace{-\baselineskip}\cs{end}\marg{document}
\end{semiverbatim}
\end{example}
\end{frame}

\begin{frame}
  \frametitle{What Are Packages For?}

  \begin{itemize}[<+->]
    \item A package can provide additional commands. Examples:

      \begin{itemize}
       \item The \sty{graphicx} package provides a command to include
          images.
       \item The \sty{parallel} package provides commands to typeset
          text in parallel (for example, one language in one column
          and the translation in the next column.)
      \end{itemize}

    \item A package can change the fonts. Examples:

      \begin{itemize}
        \item The \sty{mathptmx} package will change the serif font 
              to Times.
        \item The \sty{helvet} package will change the sans-serif
              font to Helvetica. (Needs to be scaled to work with 
              Times.)
      \end{itemize}

    \item A package can redefine existing commands. Examples:
      \begin{itemize}
         \item The \sty{datetime} package redefines \cs{today} to 
               change the format of the current date.

         \item The \sty{babel} package redefines the commands that
               provide textual labels (e.g.\ \dq{Contents},
               \dq{Chapter}, \dq{Appendix}).
      \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}[fragile]

  \begin{exercise}
  To practice loading packages, amend your document so that it
  uses Times, Helvetica and Courier. Also change the document class
  to \cls{scrartcl}. For example:
\begin{verbatim}
\documentclass[12pt]{scrartcl}
\usepackage{mathptmx}
\usepackage[scaled=.92]{helvet}
\usepackage{courier}

\begin{document}
This is a \emph{simple} document.  \textsf{Some 
sans-serif text.} \texttt{Some typewriter text.}
\end{document}
\end{verbatim}
  \end{exercise}
\end{frame}

\section{Structure}

\subsection{Titling Information}

\begin{frame}
  \frametitle{Title Page and In-Page Titles}

  \begin{itemize}[<+->]
    \item The \term{title page} is on a page of its own.

    \item The \term{in-page title} is at the top of the first
          page of the document.

    \item Both types are produced by the same command.

    \item The document class and the class options determine
          whether to use a title page or in-page title.

    \item Usually, article-like classes have an in-page title whereas
          book- and report-like classes have a title page.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Specifying the Title Information}

  \begin{itemize}[<+->]
    \item Before you can display the title page or in-page title,
          you must specify the title information.

    \item Available commands depend on the class file. For
          \cls{scrartcl} the following commands are available:
\begin{cmddef}
\cs{title}\marg{\meta{Title}}\\
\cs{author}\marg{\meta{Author(s)}}\\
\cs{date}\marg{\meta{Date}}\\
\cs{titlehead}\marg{\meta{Titlehead}}\\
\cs{subject}\marg{\meta{Subject}}\\
\cs{subtitle}\marg{\meta{Subtitle}}\\
\cs{publishers}\marg{\meta{Publisher}}
\end{cmddef}

  \end{itemize}
\end{frame}

Most class files define \cs{author}, \cs{title} and \cs{date}.
Some classes may provide other commands.

\begin{frame}
  \frametitle{Specifying and Displaying the Title Information}

  \begin{itemize}[<+->]

    \item Separate multiple authors with \cs{and}, for example:

      \texttt{\cs{author}\marg{Smith \cs{and} Jones \cs{and} Brown}}

    \item Use \texttt{\cs{thanks}\marg{\meta{Text}}} to provide
      an attribute, for example:

      \texttt{\cs{author}\marg{Jo Bloggs\cs{thanks}\marg{Funded by
      the Creative Arts Council}}}

    \item If \cs{date} is omitted, the current date is used.
          To suppress the date use \texttt{\cs{date}\marg{}}

    \item Once the information has been specified, display the
          title using \cs{maketitle}.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Displaying the Title Page or In-Page Title}

\begin{example}
\begin{semiverbatim}
\cs{documentclass}\marg{scrartcl}

\annote<2->[bg=highlight1,pos=ru,voffset=0.65in,smash]{\begin{tabular}[b]{@{}l}\cs{title}\marg{An Example Document}\\
\cs{subtitle}\marg{With a Subtitle}\\
\cs{author}\char`\{\alt<3|article:0>{\fcolorbox{gray}{highlight1}{Me\string\\University of East Anglia}}{Me\string\\University of East Anglia}\\
\cs{and} \alt<4|article:0>{\fcolorbox{gray}{highlight1}{My Shadow\string\\University of No Where}}{My Shadow\string\\University of No Where}\char`\}\\
\cs{subject}\marg{\cs{LaTeX}\cs{ }Exercise}\end{tabular}}{Specify information}

\cs{begin}\marg{document}
\annote<5->[bg=highlight2,pos=rc]{\cs{maketitle}}{Display title information}
This is a simple document\cs{footnote}\marg{with a footnote}.
\cs{end}\marg{document}
\end{semiverbatim}
\end{example}
\end{frame}

\begin{frame}[fragile]

  \begin{notes}
  \begin{itemize}
    \item \cs{LaTeX} produces the \LaTeX\ logo.

    \item Spaces are ignored after command names, so 
          \texttt{\cs{LaTeX}~Exercise} will produce \LaTeX Exercise.

    \item Force a space using \cs{~} (backslash space) for example:
          \texttt{\boxtext<2| article:0>{gray}{\cs{LaTeX}}\boxtext<3| article:0>{gray}{\cs{~}}Exercise}.
  \end{itemize}
  \end{notes}

  \begin{exercise}<4>
    \begin{itemize}
      \item Edit your document from the previous exercise so that it 
            has an in-page title.

      \item Once it's working, use the \sty{datetime} package to
            practice loading packages. What difference does it make?
\begin{verbatim}
\usepackage{datetime}
\end{verbatim}
\mode<article>{(It only makes a difference if you don't use the
\cs{date} command.)}
    \end{itemize}
  \end{exercise}

\end{frame}

\subsection{Paragraph Breaks}

\begin{frame}[fragile]
  \frametitle{Paragraph Breaks}

A paragraph break is indicated by a completely blank line or 
using \cs{par}

\begin{example}
\begin{verbatim}
This is the first paragraph. A blank line is used 
to indicate a paragraph break, but that doesn't mean 
that a blank line will appear in the PDF file.

This is the second paragraph.\par This is the third 
paragraph.
\end{verbatim}
\end{example}
\end{frame}

\begin{frame}[fragile]
\begin{exercise}
The \sty{lipsum} package provides dummy text. We'll use this in the
exercises from now on to pad out the document we're creating.

Edit your document so that it contains some paragraphs. You will need
to add:
\begin{verbatim}
\usepackage{lipsum}
\end{verbatim}
Add each paragraph using \cs{lipsum}.\only<article>{\footnote{Actually, \cs{lipsum} puts in the paragraph breaks automatically, but for this exercise we'll pretend it doesn't.}} For example:
\begin{verbatim}
\lipsum[1]
\par
\lipsum[2]

\lipsum[3]
\end{verbatim}
\end{exercise}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Changing the Paragraph Indentation and Separation}

  \begin{itemize}[<+->]
    \item To change the width of the paragraph indentation use:
\begin{cmddef}
\cs{setlength}\marg{\cs{parindent}}\marg{\meta{length}}
\end{cmddef}
    For example:
\begin{verbatim}
\setlength{\parindent}{0.5in}
\end{verbatim}
    \item With the KOMA-Script classes, you can suppress the
          paragraph indentation and add blank lines between
          paragraphs using the \clsopt{parskip} class option:
\begin{verbatim}
\documentclass[parskip]{scrartcl}
\end{verbatim}
  \end{itemize}
\end{frame}

\subsection{Sectioning Commands}

\begin{frame}
  \frametitle{Sectioning Commands}

  \begin{itemize}[<+->]
    \item Article-like classes provide the commands:
\begin{cmddef}
\cs{part}\oarg{\meta{short title}}\marg{\meta{title}}\\
\cs{section}\oarg{\meta{short title}}\marg{\meta{title}}\\
\cs{subsection}\oarg{\meta{short title}}\marg{\meta{title}}\\
\cs{subsubsection}\oarg{\meta{short title}}\marg{\meta{title}}\\
\cs{paragraph}\oarg{\meta{short title}}\marg{\meta{title}}\\
\cs{subparagraph}\oarg{\meta{short title}}\marg{\meta{title}}
\end{cmddef}
    \item If the short title is present, it's used for the
          table of contents or the page header.
    \item Book and report-like classes also provide the command:
\begin{cmddef}
\cs{chapter}\oarg{\meta{short title}}\marg{\meta{title}}\\
\end{cmddef}
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Suppressing the Section Numbering}

  \begin{itemize}[<+->]
    \item Sections/chapters etc are automatically numbered by 
          default.

    \item Use the starred version to suppress the numbering for
          an individual unit. For example:
\begin{verbatim}
\section*{Acknowledgements}
\end{verbatim}

    \item To suppress all section numbering use:
\begin{verbatim}
\setcounter{secnumdepth}{1}
\end{verbatim}
(Use \texttt{-1} for parts, \texttt{0} for chapters, \texttt{2} for 
subsections, \texttt{3} for subsubsections etc.)
  \end{itemize}  
\end{frame}

The book-like classes also provide \cs{frontmatter}, \cs{mainmatter}
and \cs{backmatter}. The \cs{frontmatter} and \cs{backmatter}
commands switch off the chapter numbering (\cs{frontmatter} also
changes the page numbering to lower case Roman numerals).

\begin{frame}[fragile]
  \frametitle{Sectioning}

\begin{example}
\begin{verbatim}
\section{Introduction}
\lipsum[1-2]

\subsection{Sample Subsection}
\lipsum[3]
\end{verbatim}
\end{example}
  \begin{exercise}
    \begin{itemize}
      \item Add some sections and sub-sections to your document. 

      \item Try changing the paragraph indentation or try the
            \clsopt{parskip} class option (but don't do both at
            the same time).

      \item Try the following class options and see what effect
            they have: \clsopt{smallheadings}, 
            \clsopt{normalheadings} and \clsopt{pointednumbers}.
    \end{itemize}
  \end{exercise}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Cross-Referencing}

  \begin{itemize}[<+->]
    \item Most things in \LaTeX\ that automatically generate a
          number can be cross-referenced.

    \item Put \texttt{\cs{label}\marg{\meta{label}}} after the
          command that generates the number. Example:
\begin{verbatim}
\section{Introduction}\label{intro}
\end{verbatim}

    \item Put \texttt{\cs{ref}\marg{\meta{label}}} where you want
          to reference it. For example:
\begin{verbatim}
See section \ref{intro} for a brief introduction.
\end{verbatim}

    \item Better to use an \term{unbreakable} space:
\begin{verbatim}
See section~\ref{intro} for a brief introduction.
\end{verbatim}

    \item Run \LaTeX\ \alert{twice} to get the references up-to-date.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Labels}

  \begin{itemize}
      \item Occasionally you need to put the label in the argument of
            the number-generating command.
\begin{example}
\begin{verbatim}
\footnote{\label{footnote}Another footnote}
\end{verbatim}
            Somewhere else in the document:
\begin{verbatim}
See footnote~\ref{footnote} on
page~\pageref{footnote}.
\end{verbatim}
\end{example}
     \item If the label is undefined, \LaTeX\ will insert ?? in
           place of the reference number and will issue a warning.
           Check the messages box for any warnings.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \begin{exercise}
    \begin{itemize}
      \item Add some cross-references to your document. (You can
            use TeXMaker's \menu{LaTeX} menu to insert the
            \cs{label} command.)

      \item Add the \sty{hyperref} package (after all other packages):
\begin{verbatim}
\usepackage[colorlinks]{hyperref}
\end{verbatim}
            The cross-references should now be hyperlinks.
    \end{itemize}
  \end{exercise}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Abstract}

  \begin{itemize}
    \item Abstracts are put in the \env{abstract} \term{environment}.
          Example:
\begin{semiverbatim}
\annote<2-3>[bg=highlight1,pos=rc]{\cs{begin}\marg{abstract}}{Start of environment}
\annote<3>[bg=highlight2,pos=rc,offset=0.4in]{\begin{tabular}{@{}l}
This is the abstract.\\
Its style depends on the\\
document class.
\end{tabular}}{The contents of the abstract}
\annote<2-3>[bg=highlight1,pos=rc]{\cs{end}\marg{abstract}}{End of environment}
\end{semiverbatim}

    \item<4> The word \dq{Abstract} will be placed at the start of
          the abstract if you use the
          \clsopt{abstracton} class option:
\begin{verbatim}
\documentclass[abstracton]{scrartcl}
\end{verbatim}
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Table of Contents}

  \begin{itemize}[<+->]
    \item Use \cs{tableofcontents} where you want the table of
          contents to appear.

    \item Typically after \cs{maketitle}.

    \item Run \LaTeX\ \alert{twice} (occasionally a third run is
          needed).

    \item By default, different sectional units have different
          indentations. To display all section numbering flush-left
          use the \clsopt{tocleft} class option.
  \end{itemize}

\begin{example}<+->
\begin{verbatim}
\begin{document}
\maketitle
\tableofcontents
\end{verbatim}
\end{example}
\end{frame}

\begin{frame}
  \begin{exercise}
    \begin{itemize}
      \item Add an abstract and a table of contents to your
            document. (Remember to use \LaTeX\ twice.)

      \item Try the class option \clsopt{abstracton} and see
            what happens.

      \item Try the class option \clsopt{tocleft} and see what
            happens.
    \end{itemize}
  \end{exercise}
\end{frame}

\subsection{Page Headings}

\begin{frame}
  \frametitle{The \sty{scrpage2} Package}

  \begin{itemize}[<+->]
    \item Page headers and footers can be changed with the 
          \sty{scrpage2} package, which comes with the KOMA-Script
          classes.

    \item There are three basic page styles: \texttt{empty},
          \texttt{scrplain} and \texttt{scrheadings}

    \item Page styles can be set using 
\begin{cmddef}
\cs{pagestyle}\marg{\meta{style}}
\end{cmddef}

    \item To set the style for the current page only:
\begin{cmddef}
\cs{thispagestyle}\marg{\meta{style}}
\end{cmddef}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Changing the Header}

  \begin{itemize}
    \item The inner, centre and outer parts of the header can be
          set using:
\begin{cmddef}
\cs{ihead}\oarg{\meta{plain inner head}}\marg{\meta{inner head}}\\
\cs{chead}\oarg{\meta{plain centre head}}\marg{\meta{centre head}}\\
\cs{ohead}\oarg{\meta{plain outer head}}\marg{\meta{outer head}}
\end{cmddef}
    \item The optional argument is used with 
          \cs{pagestyle}\texttt{\marg{scrplain}}

    \item The other argument is used with
          \cs{pagestyle}\texttt{\marg{scrheadings}}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Changing the Footer}

  \begin{itemize}
    \item The inner, centre and outer parts of the footer can be
          set using:
\begin{cmddef}
\cs{ifoot}\oarg{\meta{plain inner foot}}\marg{\meta{inner foot}}\\
\cs{cfoot}\oarg{\meta{plain centre foot}}\marg{\meta{centre foot}}\\
\cs{ofoot}\oarg{\meta{plain outer foot}}\marg{\meta{outer foot}}
\end{cmddef}
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
\begin{example}
In \alt<article>{this document}{the handout} I used:
\only<presentation>{\small}
\begin{verbatim}
\usepackage{scrpage2}

\ihead[]{An Introduction to \LaTeX}
\chead[]{}
\ohead[]{24/2/2010 \& 3/3/2010}
\ifoot[]{\url{http://theoval.cmp.uea.ac.uk/~nlct/latex/csed/}}
\cfoot[\pagemark]{}
\ofoot[]{\pagemark}
\pagestyle{scrheadings}
\end{verbatim}
\end{example}
Note that the first page has a different page style. This is because
\cs{maketitle} uses the \texttt{scrplain} style with the
\cls{scrartcl} class.
\end{frame}

\subsection{Columns}

\begin{frame}[fragile]
  \frametitle{Two Columns}

  \begin{itemize}[<+->]
    \item So far, our example document is a one column document.
          To change this, use the \clsopt{twocolumn} class option.
          For example:
\begin{verbatim}
\documentclass[twocolumn]{scrartcl}
\end{verbatim}

    \item You can also switch to two column mode using \cs{twocolumn}
          but this will cause a page break.

    \item For a short block of two (or more) column text within 
          a one column page use the \sty{multicol} package.

    \item For a more elaborate layout, you can use the \sty{flowfram}
          package.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Parallel Text}

  \begin{itemize}[<+->]
    \item To typeset two languages in parallel use the \sty{parallel}
          package.
    \item Use the \env{Parallel} environment to switch to 
          parallel formatting.
\begin{cmddef}
\cs{begin}\marg{Parallel}\marg{\meta{left width}}\marg{\meta{right width}}
\end{cmddef}
          \texttt{\meta{left width}} and \texttt{\meta{right width}}
          are the widths of the left and right columns. These can
          be absolute values, e.g.\ \texttt{2.5in}, or relative
          values, e.g.\ \texttt{0.45\cs{textwidth}}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The \env{Parallel} Environment}
  \begin{itemize}[<+->]
    \item Within the \env{Parallel} environment use:
\begin{cmddef}
\cs{ParallelLText}\marg{\meta{left text}}\\
\cs{ParallelRText}\marg{\meta{right text}}\\
\cs{ParallelPar}
\end{cmddef}

    \item \texttt{\meta{left text}} and \texttt{\meta{right text}} should
          be single paragraphs.

    \item Each set of \cs{ParallelLText} and \cs{ParallelRText}
          must be separated by \cs{ParallelPar}
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
\begin{example}\mode<presentation>{\footnotesize}
\begin{semiverbatim}
\cs{begin}\marg{Parallel}\marg{0.42\cs{textwidth}}\marg{0.42\cs{textwidth}}
\annote<2->[smash,bg=highlight1,pos=ru,offset=4mm,voffset=0.5in]{\begin{tabular}[b]{@{}l@{}}\cs{ParallelLText}\{Gallia est omnis divisa in partes tres,\\
quarum unam incolunt Belgae, aliam Aquitani, tertiam qui\\
ipsorum lingua Celtae, nostra Galli appellantur.  Hi omnes\\
lingua, institutis, legibus inter se differunt.\}\end{tabular}}{Left column}\phantom{g}
\annote<3->[smash,bg=highlight2,pos=rd,voffset=0.65in,offset=4mm]{\begin{tabular}[b]{@{}l@{}}\cs{ParallelRText}\{All Gaul is divided into three parts, one of\\
which the Belgae inhabit, the Aquitani another, those who are\\
in their own language are called Celts, in our Gauls, the\\
third. All these differ from each other in language, customs\\ 
and laws.\}\end{tabular}}{Right\\column}
\cs{ParallelPar}
\annote<2->[smash,bg=highlight1,pos=ld,voffset=0.77in,offset=2mm]{\begin{tabular}[b]{@{}l@{}}\cs{ParallelLText}\{Gallos ab Aquitanis Garumna\\
flumen, a Belgis Matrona et Sequana dividit.\}\end{tabular}}{Left\\column}\phantom{g}
\annote<3->[smash,bg=highlight2,pos=lb,offset=0.3in]{\begin{tabular}[b]{@{}l@{}}\cs{ParallelRText}\{The river Garonne separates the Gauls from the\\
Aquitani, the Marne and the Seine separate them from the Belgae.\}\end{tabular}}{Right column}
\cs{end}\marg{Parallel}
\end{semiverbatim}
\end{example}
\end{frame}

\mode<presentation>
{
\begin{frame}
  \begin{example}
\setlength{\parindent}{10.95003pt}%
\begin{Parallel}{0.42\textwidth}{0.42\textwidth}\rmfamily
\ParallelLText{Gallia est omnis divisa in
partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam
qui ipsorum lingua Celtae, nostra Galli appellantur.  Hi omnes
lingua, institutis, legibus inter se differunt.}
\ParallelRText{All Gaul is divided into three parts, one of which
the Belgae inhabit, the Aquitani another, those who are in their
own language are called Celts, in our Gauls, the third. All these
differ from each other in language, customs and laws.}
\ParallelPar
\ParallelLText{Gallos ab Aquitanis Garumna
flumen, a Belgis Matrona et Sequana dividit.}
\ParallelRText{The river Garonne separates the Gauls from the
Aquitani, the Marne and the Seine separate them from the Belgae.}
\end{Parallel}
  \end{example}
\end{frame}
}

\vskip\baselineskip
\begin{Parallel}{0.42\textwidth}{0.42\textwidth}
\ParallelLText{Gallia est omnis divisa in
partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam
qui ipsorum lingua Celtae, nostra Galli appellantur.  Hi omnes
lingua, institutis, legibus inter se differunt.}
\ParallelRText{All Gaul is divided into three parts, one of which
the Belgae inhabit, the Aquitani another, those who are in their
own language are called Celts, in our Gauls, the third. All these
differ from each other in language, customs and laws.}
\ParallelPar
\ParallelLText{Gallos ab Aquitanis Garumna
flumen, a Belgis Matrona et Sequana dividit.}
\ParallelRText{The river Garonne separates the Gauls from the
Aquitani, the Marne and the Seine separate them from the Belgae.}
\end{Parallel}

\begin{frame}[fragile]
\begin{exercise}
\begin{itemize}
\item Change your document so that it has two columns.
\item If you want (and have time) try experimenting with the
\sty{multicol} or \sty{parallel} packages.
\begin{verbatim}
\begin{multicols}{2}
\lipsum[1]
\end{multicols}
\end{verbatim}
\end{itemize}
\end{exercise}
\end{frame}

\subsection{Bibliographies}

\begin{frame}[fragile]
  \frametitle{Creating a Bibliography}
  \framesubtitle{Manual Method}

Use the \env{thebibliography} environment:
\begin{verbatim}
\begin{thebibliography}{1}
  \bibitem{lamport94} Leslie Lamport.
  \emph{\LaTeX\ : a document preparation system}.
  Addison-Wesley, 2nd edition (updated for \LaTeXe),
  1994.
\end{thebibliography}
\end{verbatim}
Disadvantages:
    \begin{itemize}
      \item You have to remember to format the entries consistently.
      \item You need to sort the entries.
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Creating a Bibliography}
  \framesubtitle{Using BibTeX}

    \begin{itemize}[<+->]
      \item Entries are stored in one or more databases. You specify 
            the database(s) using
            \texttt{\cs{bibliography}\marg{\meta{database list}}}
            where you want the bibliography to appear.
      \item You specify the bibliography style using 
            \texttt{\cs{bibliographystyle}\marg{\meta{style}}}
            (This governs the sorting as well as the formatting).
      \item Use the \app{bibtex} application to select only
            those references you've cited in the document.
    \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{BibTeX}

  \begin{itemize}[<+->]
    \item Create a new file (with \texttt{.bib} extension).
    \item Enter the details of the reference using a special
          syntax.
         (Use TeXMaker's \menu{Bibliography} menu to help you with
          the syntax.)
    \item BibTeX converts title text to lower case (depending on the 
          style) except for the first word. Enclose proper nouns in 
          curly braces to prevent this.
    \item Each entry has a unique label. Choose a naming system
          you find easy to remember.
  \end{itemize}
\end{frame}

\newpage
\begin{frame}[fragile]
  \frametitle{BibTeX Database}

\begin{example}
\begin{semiverbatim}
@\annote<2->[bg=highlight1,pos=rt,voffset=1.2cm,offset=1cm]{book}{This reference is a book}\marg{\annote<3->[bg=highlight2,pos=rt,offset=0.5in]{lamport94}{label},
   author    = "Leslie Lamport",
   title     = "\annote<4->[smash,bg=highlight3,pos=rt,voffset=1cm,offset=0.8in]{\marg{\cs{LaTeX}}}{Don't change to lower case!} : a document preparation
                system",
   edition   = "2nd",
   publisher = "Addison-Wesley",
   year      = \annote<5->[bg=highlight4,pos=rc,offset=1cm]{1994}{Plain numbers don't need quotes}
}
\end{semiverbatim}
\end{example}
\end{frame}

You can also use curly braces instead of double quotes. For 
example:\newline\verb|author = {Leslie Lamport},|

\begin{frame}[fragile]
  \frametitle{Multiple Authors}

  \begin{itemize}
    \item Separate each author with \texttt{and}.
  \end{itemize}
\begin{example}
\begin{semiverbatim}
@\annote<4->[bg=highlight2,pos=tr,offset=1cm]{inproceedings}{This reference is a conference article}\marg{smith05,
  author    = "John Smith, Jr \alert<2->{and} Jane Lucy Doe
               \alert<2->{and} Jo de Vere",
  title     = "An example article",
  booktitle = "Proceedings of the Imaginary Society",
  month     = \annote<3->[pos=rc,bg=highlight1,offset=0.5cm]{JAN}{Use 3 letter abbreviation without quotes},
  year      = 2005
}
\end{semiverbatim}
\end{example}
\end{frame}

(If you use the three letter month abbreviations, the month name
will either be expanded or abbreviated, depending on the
bibliography style.)

\begin{frame}
  \frametitle{Citations}

  \begin{itemize}
    \item<+-> By default, citations are numerical.
    \item<+-> For more flexibility use a bibliography package. Examples:
    \begin{itemize}
      \item \sty{natbib}
      \item \sty{newapa}
      \item \sty{biblatex}\dash new, very flexible.
    \end{itemize}
    \item<+-> We will be using the \sty{natbib} package with the 
          \bst{plainnat} bibliography style.
    \begin{itemize}
      \item Can choose between numerical and author year formats.
      \item Can have textual and parenthetical citations.
    \end{itemize}
  \end{itemize}
\end{frame}

Other bibliography styles provided by the \sty{natbib} package are
\bst{abbrvnat} and \bst{unsrtnat}.

\begin{frame}[fragile]

\begin{example}
Assume the bibliography database is called \texttt{myrefs.bib}:

\begin{semiverbatim}
\cs{documentclass}\marg{scrartcl}
\annote<2->[pos=tr,bg=highlight1]{\cs{usepackage}\marg{natbib}}{Load bibliography package}
\annote<3->[pos=rc,bg=highlight2,offset=1cm]{\cs{bibliographystyle}\marg{plainnat}}{Specify bibliography style}

\cs{begin}\marg{document}
Main matter with citations such as \smash{\annote<4->[pos=tl,bg=highlight3]{\cs{citet}\marg{lamport94}}{Citation}}.

\annote<5->[pos=rc,bg=highlight4,offset=0.5cm]{\cs{bibliography}\marg{myrefs}}{This is where the bibliography will go}
\cs{end}\marg{document}
\end{semiverbatim}
\end{example}
\end{frame}

\begin{frame}
  \frametitle{Citations (\sty{natbib})}

  \begin{itemize}[<+->]
    \item \emph{Textual} citation:
    \texttt{\cs{citet}\oarg{\meta{note}}\marg{\meta{label}}}

\begin{example}\mode<article>{\mbox{}\newline\upshape}
\begin{tabular}{l@{\ $\Rightarrow$\ }l}
\ttfamily\cs{citet}\marg{lamport94} & Lamport (1994)\\
\ttfamily\cs{citet}\oarg{p.\textasciitilde34}\marg{lamport94} & Lamport (1994, p.~34)\\
\end{tabular}\par
\mode<article>{(Recall the tilde \texttt{\textasciitilde} is a non-breakable space.)}
\end{example}

    \item \emph{Parenthetical} citation:
    \texttt{\cs{citep}\oarg{\meta{pre}}\oarg{\meta{post}}\marg{\meta{label}}}

\begin{example}\mode<article>{\mbox{}\newline\upshape}
\begin{tabular}{l@{\ $\Rightarrow$\ }l}
\ttfamily\cs{citep}\marg{lamport94} & (Lamport, 1994)\\
\ttfamily\cs{citep}\oarg{p.\textasciitilde34}\marg{lamport94} & (Lamport, 1994, p.~34)\\
\ttfamily\cs{citep}\oarg{see}\oarg{}\marg{lamport94} & (see Lamport, 1994)
\end{tabular}
\end{example}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{KOMA-Script}

  With the KOMA-Script classes you can:

  \begin{itemize}[<+->]
    \item Add a preamble to the bibliography using
\begin{cmddef}
\cs{setbibpreamble}\marg{\meta{preamble}}
\end{cmddef}

    \item Add the bibliography to the table of contents using the
          class option \clsopt{bibtotoc}

    \item Make the bibliography a numbered section/chapter using the
          class option \clsopt{bibtotocnumbered}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Workflow}

\small\mode<article>{\footnotesize}
  \resizebox{\linewidth}{!}{%
  \begin{tikzpicture}[thick]
  \begin{scope}[minimum width=1.5cm,minimum height=1.5cm,inner sep=.1em]
  \path (0,0) node[draw] (edit) {\shortstack{Edit\\.tex\\File}};
  \path (0,2) node[draw] (editbib) {\shortstack{Edit\\.bib\\File}};
  \uncover<2->{\path (3.2,1) node[draw,diamond] (errors) {\shortstack{Any\\Errors?}};}
  \uncover<4->{\path (6.8,1) node[draw,diamond] (bibtexerrors) {\shortstack{Any\\Errors?}};}
  \uncover<6->{\path (10,1) node[draw,diamond] (errors2) {\shortstack{Any\\Errors?}};}
  \uncover<8->{\path (12.5,1) node[draw] (pdf) {\shortstack{View\\PDF}};}
  \end{scope}
  \uncover<7->{\path (8.5,4.5) node[draw,rectangle] (rmbbl) {Remove .bbl file};}
  \uncover<2->{\draw[->] (edit) -- (1,1) -- (errors) node[midway,above] {\shortstack{\LaTeX\\.tex file}};}
  \uncover<2->{\draw (editbib) -- (1,1);}
  \uncover<3->{\draw[->] (errors) -- ++(0,-2) node[midway,left] {Yes}
    -| (edit) node[pos=0,below,anchor=north east] {Error in document};}
%  \uncover<3->{\draw[->] (errors) -- ++(0,2) node[midway,left] {Yes}
%    -| (editbib) node[pos=0,above,anchor=south east] {Error in bibliography};}
  \uncover<4->{\draw[->] (errors) -- (bibtexerrors)
    node[midway,above] {\shortstack{No errors.\\Run BibTeX}};}
  \uncover<5->{\draw[->] (bibtexerrors) -- ++(0,-2.75)
    node[midway,right] {Yes} -| (edit) 
    node[pos=0,below,anchor=north east] {Misspelt/missing label or bib style};}
  \uncover<5->{\draw[->] (bibtexerrors) -- ++(0,2.75) node[midway,right] {Yes} -| (editbib) node[pos=0,above,anchor=south east] {Error in bib file};}
  \uncover<6->{\draw[->] (bibtexerrors) -- (errors2) node[midway,above] {\shortstack{No errors.\\Run \LaTeX\\(twice)}};}
  \uncover<7->{\draw[->] (errors2) |- (rmbbl) node[pos=0.2,right] {Yes};
  \draw[->] (rmbbl) -| (editbib);}
  \uncover<8->{\draw[->] (errors2) -- (pdf) node[midway,above] {No};}
  \end{tikzpicture}}

\end{frame}

You can remove the \texttt{.bbl} using TeXMaker's 
\menu{Tools}\menuitem{Clean} menu item.

\mode<presentation>
{
  \ifshowanimation
    \begin{frame}
      \frametitle{Example}

      \animate<2-3>
      \animate<6-12>
      \animate<14-35>
      \animate<38-62>
      \animate<64-86>
      \animate<89-89>
      \animate<92-92>
      \animate<95-133>
      \animate<135-148>
      \animate<151-156>
      \animate<161-166>
      \animate<168-179>
      \animate<181-182>

      \centering

      \multiinclude[<+>][graphics={width=0.8\linewidth},format=jpg,start=1]{images/bibtex}

    \end{frame}
  \fi
}

\begin{frame}
  \begin{exercise}
    Create a bibliography for your document:
      \begin{itemize}
        \item Make a new file.
        \item Use the \menu{Bibliography} menu to help create some references.
        \item Save the file.
        \item Use \cs{citet} or \cs{citep} in your document.
        \item Run \app{pdflatex}, \app{bibtex}, \app{pdflatex}, \app{pdflatex} and view the
              PDF file.
      \end{itemize}
  \end{exercise}
\end{frame}

\section{Multilingual Support}

\begin{frame}
  \frametitle{Multilingual Support}

  \begin{itemize}[<+->]
    \item Different languages have different hyphenation patterns.

    \item Predefined text, such as \dq{Chapter} and \dq{Contents},
          should change if you are not writing in English.

    \item Different languages use different quotation marks.

    \item Need to tell \LaTeX\ what language you are using if you're
          not writing in English.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Packages}

  \begin{itemize}
    \item \sty{babel} (supports 41 languages)
    \item \sty{translator} 
    \item \sty{polyglossia} (XeLaTeX)
    \item Other packages for specific languages (e.g. \sty{arabtex},
          \sty{bangtex}, \sty{cjk})
  \end{itemize}
\end{frame}

\subsection{babel}
\begin{frame}[fragile]
  \frametitle{Using \sty{babel}}

  \begin{itemize}[<+->]
    \item Specify the languages in the class option. For example:
\begin{verbatim}
\documentclass[french,english]{scrartcl}
\end{verbatim}
    The last named language is the default language.

    \item Load \sty{babel}:
\begin{verbatim}
\usepackage{babel}
\end{verbatim}

    \item Use
\begin{ttfamily}%
\cs{selectlanguage}\marg{\meta{language}}
\end{ttfamily}
          to switch to another language.

    \item Use
\begin{ttfamily}%
\cs{foreignlanguage}\marg{\meta{language}}\marg{\meta{text}}
\end{ttfamily}
          to typeset a phrase in another language.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
\begin{example}
\begin{semiverbatim}
\cs{documentclass}\oarg{\annote<2->[bg=highlight1,pos=tr]{latin,english}{Languages used in this document}}\marg{scrartcl}
\annote<3->[bg=highlight2,pos=rc]{\cs{usepackage}\marg{babel}}{Load babel}
\cs{begin}\marg{document}
According to Horace, we should
\cs{foreignlanguage}\marg{latin}\annote<4->[bg=highlight3,smash,pos=br]{\marg{carpe diem}}{Latin phrase}
or seize the day.

\annote<5->[bg=highlight4,pos=rc]{\cs{selectlanguage}\marg{latin}}{Switch to Latin}
Carpe diem, quam minimum credula postero.
\cs{end}\marg{document}
\end{semiverbatim}
\end{example}
\end{frame}

\subsection{Symbols}
\begin{frame}
  \frametitle{Quote Marks}

  \begin{itemize}[<+->]
    \item Use \sty{csquotes} to use language dependent quotation
          marks.

    \item Use the package option \texttt{babel} to ensure the
          quotation marks switch with the language.

    \item Use \texttt{\cs{enquote}\marg{\meta{text}}} to quote
          some text.

    \item \cs{enquote} can be nested.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
\begin{example}
\begin{semiverbatim}
\cs{documentclass}\oarg{french,american,british}\marg{scrartcl}
\annote<5->[bg=highlight4,pos=rc]{\cs{usepackage}\oarg{T1}\marg{fontenc}}{Need to set the encoding}
\cs{usepackage}\marg{babel}
\cs{usepackage}\oarg{babel}\marg{csquotes}
\cs{begin}\marg{document}
\annote<2->[bg=highlight1,pos=br]{\cs{enquote}\marg{Hello,}}{Single quotes} I said.
\cs{selectlanguage}\marg{american}
\annote<3->[bg=highlight2,pos=br]{\cs{enquote}\marg{Hello,}}{Double quotes} I said.
\cs{selectlanguage}\marg{french}
\annote<4->[bg=highlight3,pos=rd,offset=2mm,voffset=6mm,smash]{\cs{enquote}\marg{Bonjour,}}{Guillemets} j'ai dit.
\cs{end}\marg{document}
\end{semiverbatim}
\end{example}
\end{frame}

\vskip\baselineskip

\begin{frame}
  \frametitle{Diacritics}

  \begin{itemize}[<+->]
    \item If you use the \sty{inputenc} package, you can
          directly enter the character using the relevant keyboard
          combination.

    \item You must set the correct encoding. In the UK, this
          will typically be either \texttt{latin1} or \texttt{utf8}.

    \item This will cause a problem if you are sharing your code
          with someone who uses a different encoding.
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
\begin{example}
\begin{semiverbatim}
\cs{documentclass}\marg{scrartcl}
\cs{usepackage}\oarg{T1}\marg{fontenc}
\cs{usepackage}\oarg{utf8}\marg{inputenc}
\cs{begin}\marg{document}
It's na\"ive to think that eating mouldy p\^at\'e
won't result in food poisoning.
\cs{end}\marg{document}
\end{semiverbatim}
\end{example}
\end{frame}

\begin{frame}
  \frametitle{Encoding Independent}

  \begin{itemize}[<+->]
    \item If you don't want to use the \sty{inputenc} package,
          you can use \LaTeX\ commands to produce diacritics.

    \item In TeXMaker, you can use the 
          \menu{LaTeX}\menuitem{International Accents} menu.

    \item Other diacritic commands are also available for particular
          symbols. Examples:
\begin{center}
\begin{tabular}{ll@{\qquad}ll}
\cs{O} & \O & \cs{o} & \o\\
\cs{AA} & \AA & \cs{aa} & \aa\\
\cs{L} & \L & \cs{l} & \l
\end{tabular}
\end{center}
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
\begin{example}
\begin{verbatim}
It's na\"ive to think that eating mouldy p\^at\'e 
won't result in food poisoning.
\end{verbatim}
\end{example}
(On some older systems you'll need to use \cs{i} or \cs{j} when
putting accents on an i or j, e.g.\ \verb|na\"{\i}ve|.)
\end{frame}

\begin{frame}
  \frametitle{Ligatures}

  \begin{itemize}[<+->]
    \item The f-ligatures are converted automatically
          (ff, fl, fi, ffl, ffi).

    \item This can cause a problem searching a PDF when viewing
          on-line.

    \item Use the \sty{cmap} package to make searching easier.

    \item Other ligatures can be obtained using \LaTeX\ commands.
          Examples:
\begin{center}
\begin{tabular}{ll@{\qquad}ll}
\cs{AE} & \AE & \cs{ae} & \ae\\
\cs{OE} & \OE & \cs{oe} & \oe
\end{tabular}
\end{center}
  \end{itemize}

\end{frame}

\begin{frame}[fragile]
\begin{example}
\begin{verbatim}
His unwise man\oe uvre caused a h\ae morrhoid.
\end{verbatim}
produces: 
His unwise man\oe uvre caused a h\ae morrhoid.
\end{example}
\begin{notes}
  \begin{itemize}
    \item Can also write \texttt{man\cs{oe}\marg{}uvre}
          and \texttt{h\cs{ae}\marg{}morrhoid} but not
          \texttt{man\cs{oeuvre}} or \texttt{h\cs{aemorrhoid}}.

    \item A space or empty braces are needed to separate the
          command name from the rest of the text.
  \end{itemize}
\end{notes}
\end{frame}

A full list of symbols is available in the Comprehensive List of
Symbols by Scott~Pakin at \url{http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/comprehensive.html}

\begin{frame}
  \begin{exercise}
  \begin{itemize}
    \item Add the \sty{babel} package to your document.
    \item Remember to specify the language(s) in the class options.
    \item If you've set the language to something other than
          English, have you noticed a difference in the document?
  \end{itemize}
  \end{exercise}
\end{frame}

\section{Font Styles}

\subsection{Font Changes}

\begin{frame}
  \frametitle{Font Commands}
  
  \begin{itemize}[<+->]
  \item We've already used some font changing commands. For example
        \cs{emph}\texttt{\marg{simple}} emphasizes the word
        \dq{simple}. This toggles italic and upright depending on
        the surrounding font.
  \item In TeXMaker, you can use \menu{LaTeX}\menuitem{Font Styles} 
        to select the style you want
        (e.g.\ \menu{\cs{emph} - Emphasis [selection]})

  \item These commands are called \term{text-block} commands.
        They change the font for the text given in the argument.

  \item To \alert{switch} the font, you can use a 
        \term{declaration} or an environment.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Font Declarations}

  \begin{center}
    \begin{tabular}{ll}
    \cs{rmfamily} & \rmfamily Serif\\
    \cs{sffamily} & \sffamily Sans-serif\\
    \cs{ttfamily} & \ttfamily Typewriter\\\hline
    \cs{mdseries} & \mdseries Medium weight\\
    \cs{bfseries} & \bfseries Bold weight\\\hline
    \cs{itshape} & \rmfamily\itshape Italic\\
    \cs{slshape} & \slshape Slanted\\
    \cs{upshape} & \upshape Upright\\
    \cs{scshape} & \rmfamily\scshape Small Caps\\
    \cs{em}      & \em Emphasized
    \end{tabular}
  \end{center}
\end{frame}

\newpage
\begin{frame}
  \frametitle{Size Declarations}

  \begin{center}
    \begin{tabular}{ll}
    \cs{Huge} & \Huge Huge\\
    \cs{huge} & \huge huge\\
    \cs{LARGE} & \LARGE LARGE\\
    \cs{Large} & \Large Large\\
    \cs{large} & \large large\\
    \cs{normalsize} & \normalsize normalsize\\
    \cs{small} & \small small\\
    \cs{footnotesize} & \footnotesize footnote size\\
    \cs{scriptsize} & \scriptsize scriptsize\\
    \cs{tiny} & \tiny tiny
    \end{tabular}
  \end{center}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Environments}

  Environments have the same name as the declarations \alert{without}
  the leading backslash.

\begin{example}
\begin{semiverbatim}
\cs{normalfont}
Some normal text.
\cs{begin}\marg{large}\annote<2->[bg=highlight1,pos=rc,smash]{\cs{bfseries}}{Only has effect\\until the end of\\the environment}
Some large bold text.
\cs{end}\marg{large}
Some normal text.
\end{semiverbatim}
Produces: \normalfont
Some normal text.
\begin{large}\bfseries
Some large bold text.
\end{large}
Some normal text.
\end{example}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Changing the Default Font}

  \begin{itemize}
    \item Most classes use the serif font as the default.

    \item If you want the default font to be sans-serif or
          typewriter you need to redefine \cs{familydefault}:

    \begin{itemize}
      \item For sans-serif do:
\begin{verbatim}
\renewcommand*{\familydefault}{\sfdefault}
\end{verbatim}
      \item For typewriter do:
\begin{verbatim}
\renewcommand*{\familydefault}{\ttdefault}
\end{verbatim}
    \end{itemize}

    \item \cs{normalfont} will now use sans-serif or typewriter,
          respectively.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Typesetting URLs}

  \begin{itemize}[<+->]
    \item Web addresses are typically typeset using a typewriter font.
    \item Web addresses sometimes contain \TeX's special characters.

    \item Web addresses are sometimes very long, but shouldn't
          be hyphenated across a line break.

    \item Can't just use \cs{texttt}.

    \item Use \sty{hyperref} or \sty{url} packages:
\begin{cmddef}
\cs{url}\marg{\meta{address}}
\end{cmddef}
  \end{itemize}
\end{frame}

\subsection{Changing the Heading Fonts}

\begin{frame}[fragile]
  \frametitle{Heading Fonts}

  \begin{itemize}
    \item The KOMA-Script classes make it easy to change the 
          font used in the headings.

    \item Use 
\begin{cmddef}
\cs{addtokomafont}\marg{\meta{type}}\marg{\meta{declarations}}
\end{cmddef}
          where \texttt{\meta{type}} indicates what you are 
          changing.
  \end{itemize}
\begin{exercise}
Change the section headings in your document to serif medium weight 
italic:
\begin{verbatim}
\addtokomafont{section}{\rmfamily\mdseries\itshape}
\end{verbatim}
\end{exercise}
\end{frame}

\section{Help}

\begin{frame}
  \frametitle{Package and Class Documentation}

  \begin{itemize}
    \item Try using the \app{texdoc} application:
      \begin{enumerate}
       \item Go to the \menu{Start} menu and then select \menu{Run\ldots}
       \item Type \texttt{texdoc} followed by a space and then
             the name of the class or package. For example:
             \texttt{texdoc natbib}
      \end{enumerate}
   \item Try going to the web address \texttt{http://www.ctan.org/pkg/\emph{package-name}} where \texttt{\emph{package-name}} is
         the name of the package. For example:
         \url{http://www.ctan.org/pkg/natbib}
   \item Try searching for the package in the \TeX\ Catalogue:
         \url{http://www.tex.ac.uk/tex-archive/help/Catalogue/}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Links}

  \begin{itemize}
    \item The UK TUG FAQ: \url{http://www.tex.ac.uk/faq}
    \item The \TeX\ Users Group: \url{http://www.tug.org/}
    \item The \LaTeX\ Community: \url{http://www.latex-community.org/}
    \item comp.text.tex archives: \url{http://groups.google.com/group/comp.text.tex/}
    \item texhax archives: \url{http://tug.org/pipermail/texhax/}
    \item TeXMaker: \url{http://www.xm1math.net/texmaker/}
    \item My \LaTeX\ web page: \url{http://theoval.cmp.uea.ac.uk/~nlct/latex/}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Books}

  \begin{itemize}
  \item Helmut Kopka and Patrick W. Daly. \emph{A Guide to \LaTeX}.
         Addison-Wesley.
  \item Michel Goossens, Frank Mittelbach and Alexander Samarin. 
        \emph{The \LaTeX\ Companion}. Addison-Wesley.
  \item Leslie Lamport. \emph{\LaTeX: a Document Preparation System}.
        Addison-Wesley.
  \end{itemize}
\end{frame}

\end{document}
