\documentclass[aspectratio=32,t]{beamer}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{endnotes}
\usepackage{url}
\usepackage{color}
\usepackage{xfrac}
\usepackage[ampersand]{easylist}
%\usepackage{mathds}
%\usetheme{Warsaw}
%\usetheme{default}
%\usetheme{AnnArbor}
%\newcommand{\ket}[1]{|\,#1\,\rangle}
\newcommand{\ket}[1]{|#1\rangle}
\usepackage{hyperref}  
\hypersetup{colorlinks=true}          
                                


\mode<presentation>{\usetheme{Warsaw}}
%\input{Physics_Macros}
\input{Logic_Symbols_v6}


\title[The Joys of \LaTeX]{The Joys of \LaTeX:\\
An Entry Guide for the Potentially Obsessive}


\author{Kent A. Peacock}

\institute{
\textsl{Department of Philosophy\\ University of Lethbridge}
}

% Theorems.  (Theorem def'ns must be in the preamble.)  
%\newtheorem{thm1}{\centering =I}
%\newtheorem{thm2}{\centering =E}
%



\date{\today}

\begin{document}


\begin{frame}  
\titlepage
\end{frame}

\section{Overview and History}  %%%%%%%%%%%%%%%%%%%

\begin{frame} %
\frametitle{What Is \LaTeX?}
\begin{itemize}[<+->]
\item \LaTeX is a document formatting system widely used in technical subjects such as logic, math, physics, linguistics, computer science, philosophy of science\dots
\item It has been in use since the 1980s and remains the industry standard; nothing else compares in the quality of output and the huge range of symbols and images that can be produced---if you know how!!
\item \LaTeX\ allows you to format beautiful equations beautifully:
\begin{equation}
  R_{\mu\nu} - \sfrac{1}{2}\,g_{\mu\nu}R = T_{\mu\nu}
\end{equation}
\end{itemize}

%\pause

\end{frame}

%%%

\begin{frame}
\frametitle{\TeX}
%
\begin{itemize}[<+->]
\item \LaTeX\ is based on \TeX, created by Donald Knuth (1938--)  in the 1970s.
\begin{center}
\includegraphics[scale=.2]{Knuth.jpg}
\end{center}
\item N.b.:  \TeX\ is pronounced ``tech'' with a gutteral ``ch'' as in ``Loch''.  (It is derived from the Greek $\tau\epsilon\chi\nu\eta$, ``techne.'')
\end{itemize}
%
\end{frame}


%%%

\begin{frame}
\frametitle{\LaTeX}
%
\begin{itemize}[<+->]
\item In 1986, Leslie Lamport (1941--) created \LaTeX, a system of macros written in \TeX\ designed to simplify document preparation.
\begin{center}
\includegraphics[scale=.1]{Lamport.jpg}
\end{center}
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}
\frametitle{\TeX\ \textit{versus} \LaTeX}
%
\begin{itemize}[<+->]
\item \TeX\ is a powerful language that allows you to command a laser printer to do virtually anything that it is physically possible for it to do.
\item Drawback:  if all you want to do is write papers in logic etc., it is too much work to construct your documents entirely from scratch.  
\item So Lamport wrote a set of \TeX\ commands (macros) which define standardized ways of setting up papers, books, etc.  It has all the power of \TeX\ if you want to use it but greatly speeds up most formatting tasks.  
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}
\frametitle{The \LaTeX\ Community}
%
\begin{itemize}[<+->]
\item  Important:  \TeX\ and \LaTeX\ are open software; unlike proprietary software such as MS Word, the source code is available and anyone is free to modify or add to it (so long as you call your version something different). 
\item Since Lamport published \LaTeX\ in 1986, hundreds of people have improved it and added innumerable special tools (``packages'') to increase its usefulness.  
\item There are several versions of \LaTeX\ available \emph{via} free download.  
\end{itemize}
%
\end{frame}


%%%%

\section{Basic Concepts}  %%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{\LaTeX\ \emph{vs.}\ Word}
%
\begin{itemize}[<+->]
\item Common word processors such as MS Word are WYSIWYG---``What you see is what you get.''
\item \LaTeX\ is a ``markup language,'' a programming language in which you write formatting commands and text in an \emph{input} file and then process the file to produce your \emph{output}.  
\item The input file is written in text (ASCII) characters (in simple terms, the characters on a standard computer keyboard).
\item The output file can be in several forms but these days it is most commonly .pdf, which is almost universally used and very stable (unlike Word!!).  
\end{itemize}
%
\end{frame}


%%%%

%%%%





\section{Text Mode}


\begin{frame}
\frametitle{Basic Process}
%
\begin{itemize}[<+->]
\item You write an \emph{input file} in ASCII code using a ``front end'' (such as TeXWorks, which comes bundled with MiKTeX).  
\begin{itemize}[<+->]
\item The ``front end'' consists of a text editor and other tools (such as spell-checkers), usually designed for work in \LaTeX.
\item \href{http://www.winedt.com/index.html}{WinEDT} is a particularly good \LaTeX\ front-end.
\end{itemize}
\item The file is processed by a compiler which generates an output file with all type, graphics as you commanded; usually in .pdf form.
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle{Basic Document Structure}
%
\begin{itemize}[<+->]
\item Open with \verb|\documentclass| statement.
\begin{itemize}[<+->]
\item Typical:  \verb|\documentclass[12pt]{article}|
\end{itemize}
\item Next, the \emph{preamble}, which typically loads packages and contains other global instructions.
\item \verb|\begin{document}|
\item The content of your document.
\item \verb|\end{document}|
\item You can ``store'' templates, out-takes, or comments after the \verb|\end{document}| since nothing after that statement is processed.  
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle{Entering Text}
%
\begin{itemize}[<+->]
\item Type your content in text characters.
\item All commands begin with the backslash: \verb|\|.
\item Construct accented letters and other special characters with appropriate commands:
\begin{itemize}[<+->]
\item E.g.:  \verb|{'e}| gives {\'e}.
\item E.g.: \verb|\S| gives \S\ (section indicator).
\item Control characters \%, \$, \&, \verb|\| must have a back-slash ('escape character') if you want to use them as a character; e.g., \verb|\&| gives \&.  
\end{itemize}
\item Just type:  text will wrap automatically; \LaTeX\ interprets an extra line as a paragraph break.  But spaces between letters are ignored.  
\end{itemize}
%
\end{frame}

%%%%


\begin{frame}[fragile]
\frametitle{Logical Structure of Your Document}
%
\begin{itemize}[<+->]
\item Use sectioning commands to define structure (the order in which you want to present your story).
\item You can cut and paste your sections, and \LaTeX\ will automatically number them; you only have to worry about content.  
\item Structure can be defined using \verb|\chapter| (in the book class), \verb|\section|, \verb|\subsection|, etc.  
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle{Environments}
%
\begin{itemize}[<+->]
\item There are many ``environments'' which define specific kinds of formatting.
\item Example
\begin{verbatim}
  \begin{center}
    Centred text.
  \end{center}
\end{verbatim}
Gives
  \begin{center}
    Centred text.
  \end{center}
\item There are ``list-making environments'' that generate bulleted lists, numbered lists, etc.  
\end{itemize}
%
\end{frame}
%%%%


\begin{frame}[fragile]
\frametitle{Indexes, Tables, Tables of Contents}
%
\begin{itemize}[<+->]
\item There are commands to construct tables (though these can be tricky\dots).
\item Tables of contents are constructed automatically in the \verb|book| document class; just put in a new chapter or section, and it is added to the table of contents.
\item There are packages for indexes.
\item Footnotes are built into basic \LaTeX; you need special packages for end-notes.  
\item The command \verb|\dots| gives ellipsis \dots
\end{itemize}
%
\end{frame}


%%%%


\begin{frame}[fragile]
\frametitle{Graphics}
%
\begin{itemize}[<+->]
\item The original graphics capability of \LaTeX\ was limited, but many, many packages have been created over the years; I provide links to some in my 'Resources' web page:  \url{http://scholar.ulethbridge.ca/kentpeacock/resources}.
\item With the \verb|graphicx| package it is quite easy to include illustrations.
\end{itemize}
%
\end{frame}


%%%%




\begin{frame}[fragile]
\frametitle{The Little Things That Make Your Work Look Professional}
%
\begin{itemize}[<+->]
\item Use accent grave for left quote marks, the apostrophe  for right quote marks.
\begin{itemize}[<+->]
\item  Thus,  \verb|``quote''| will give ``quote''.
\item Do \emph{not} use the ASCII double-quote character; a sure mark of the rank amateur!
\end{itemize}
\item Form dashes correctly:
\begin{itemize}[<+->]
\item Use \verb|-| as a hyphen, as in ``multi-use''.
\item Use two hyphens to form en-dash --, as in date or number ranges.  (``Read pp.\ 44--55 of the text.'')
\item Use three hyphens to form em-dash, which is a punctuation dash used for an emphatic break.  (``No candidate---not even Clinton---has said enough about climate.'')
\end{itemize}
\end{itemize}
%
\end{frame}


%%%%



\section{Math Mode}

\begin{frame}[fragile]
\frametitle{Math Mode}
%
\begin{itemize}[<+->]
\item \LaTeX\ has powerful capabilities to format mathematics.
\item You have to go into ``math mode''.  This is indicated by dollar signs \verb|$| or by entering certain math environments.  
\item You can have in-line math symbols:  e.g., \verb|$e^{i\pi}=-1$| gives $e^{i\pi}=-1$.
\item Greek letters can be done in math mode:  \verb|$\alpha$| gives $\alpha$.  
\item Or you can display your math in a huge variety of ways (especially using \verb|amsmath|).  
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle{Display Math}
%
\begin{verbatim}
\begin{equation}
   \int_{-\infty}^{\infty} \,e^{-x^2} dx = \sqrt{\pi}
\end{equation}
\end{verbatim}
gives
\begin{equation}
\int_{-\infty}^{\infty} \,e^{-x^2} dx = \sqrt{\pi}.
\end{equation}

%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle{Combining Text and Math}
%
\begin{itemize}[<+->]
\item The \verb|amsmath| package has a very useful command \verb|\text| which allows one to put text in a formula:
\item \verb|$\text{$x^3+3x=7$  when $x=1$}$| gives
\begin{equation*}
\text{$x^3 + 3x=7$ when $x=1$.}
\end{equation*}
\item  Note: I put the whole line in \verb|\text| because that gets the spacing right!
\item  Word to the wise:  use math mode for symbols in text that are mathematical.  E.g., say \verb|let $p$ be a prime such that|, \emph{not} \verb|let p be a prime such that|\dots
\end{itemize}
%
\end{frame}
%%%%


\begin{frame}[fragile]
\frametitle{Logic Symbols}
%
\begin{itemize}[<+->]
\item \LaTeX\ has all the standard logic symbols:  $\text{$\exists$, $\forall$, $\vee$, $\supset$, $\neg$, etc.}$
\item There is a package that does Fitch notation, and several that do truth trees (though this remains a work in progress).  
\end{itemize}
%
\end{frame}


%%%%




\begin{frame}[fragile]
\frametitle{Macros}
%
\begin{itemize}[<+->]
\item You can define your own symbols using \verb|\newcommand|.
\item To get the Russell up-side-down iota, you can use \\
\verb|\newcommand{\Russell}{\rotatebox[origin=c]{180}{$\iota$}}| \\
(This requires the \verb|graphicx| package.)
\item Example of usage:  \verb|$\Russell xFx$| gives $\Russell xFx$, which is read, ``The $x$ such that $Fx$''.
\end{itemize}
%
\end{frame}
%%%%

%%%%

\begin{frame}[fragile]
\frametitle{Macros with Parameters}
%
\begin{itemize}[<+->]
\item 
\begin{verbatim}
\newcommand{\ket}[1]{|#1\rangle}
\end{verbatim}
defines a Dirac ``ket'' that can have any symbol put in place of the \verb|#1|.
\item So \verb|$\ket{\psi}$| gives $\ket{\psi}$.
\end{itemize}
%
\end{frame}
%%%%


\section{Bibliographies and Citation}

\begin{frame}[fragile]
\frametitle{Citation}
%
\begin{itemize}[<+->]
\item Two options:  use the bibliography function built into \LaTeX, or use BibTeX.  
\item Example of inbuilt bibliography:
\begin{verbatim}
{\frenchspacing\raggedright
\begin{thebibliography}{99}
\bibitem{AA80}
  Aharonov, Y., and D. Albert (1980):  `States and 
 Observables in Relativistic Quantum  Field Theories', 
\textsl{Physical Review D} 21, 3316--3324.
\end{thebibliography}
}
\end{verbatim}
\item Use \verb|\cite[p. 3316--7]{AA80}| to cite this reference.
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle{BibTeX}
%
\begin{itemize}[<+->]
\item Create a \verb|yourbib.bib| file, which is a database of all your references.  
\item Where you want the bibliography to appear, include this code: 
\begin{verbatim}
\bibliographystyle{plain}
\bibliography{yourbib}
\end{verbatim}
\item Advantages:  
\begin{itemize}[<+->]
\item There are many style files (and you can create your own).
\item Once you have entered a reference in your \verb|.bib| database, you never have to enter it again.
\item It integrates with other citation management systems such as Zotero.  
\end{itemize}
\item Disadvantage:  BibTeX can be temperamental and there is a learning curve to climb.  
\end{itemize}
%
\end{frame}


%%%%


\section{Have Fun!}


\begin{frame}
\frametitle{Survival Tips for the \LaTeX\ Rookie}
%
\begin{itemize}[<+->]
\item Compile your document frequently; that way you catch errors as soon as they occur.
\begin{itemize}[<+->]
\item Most common error is mis-matched curly brackets!
\end{itemize}
\item Use the defaults; don't try to construct your own document styles until you really know what you are doing.  
\item As with all programming, it is good practice to \emph{comment} any complicated code so that you won't forget how it was supposed to work!
\begin{itemize}[<+->]
  \item Comment character:  \%.
\end{itemize}
\item Warning!  \LaTeX\ is addictive!
\end{itemize}
%
\end{frame}

\begin{frame}[fragile]
\frametitle{\LaTeX\ Resources}
%
\begin{itemize}[<+->]
\item See \url{http://scholar.ulethbridge.ca/kentpeacock/resources}.
\end{itemize}
%
\end{frame}


%%%%

\end{document}





%%%%%%%%%%%%%%




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Templates:

%%%%

\begin{frame}
%
\begin{itemize}[<+->]
\end{itemize}
%
\end{frame}


%%%%

\begin{frame}[fragile]
\frametitle
%
\begin{itemize}[<+->]
\end{itemize}
%
\end{frame}


%%%%


\begin{frame}{}
\begin{itemize}[<+->]
\item 
\item 
\item 
\end{itemize}
\end{frame}


%%%%   Bibliography, allowing for breaks:

\begin{frame}[allowframebreaks]
\frametitle{References}
{\tiny\frenchspacing\raggedright
\begin{thebibliography}{99}

\bibitem{Aristotle_SE}
  Aristotle.  \textit{De Sophisticis Elenchis}.  Online at
  \url{http://etext.lib.virginia.edu/toc/modeng/public/AriSoph.html};
  retrieved June, 2012.

\end{thebibliography}
}
\end{frame}

%%%%%%

Links to include:

http://www.tug.org/begin.html

https://en.wikibooks.org/wiki/LaTeX 


\hypersetup{
colorlinks=true,                % Use coloured text for links (default false: coloured boxes around text)
linkcolor=red,                  % Color for normal internal links (default red)
anchorcolor=black,              % Color for anchor text (default black)
citecolor=green,                % Color for citations in text (default green)
urlcolor=cyan,                  % Color for linked URLs (default cyan)
bookmarksnumbered=true,         % Number bookmarks by chapter and section number
%backref=true,                  % Adds backlink from bibliography as list of section numbers
%hyperfootnotes=true,           % Get footnote marks link back to text (not working)
linktocpage=false               % True: Make page numbers in TOC the link (default false: section title is the link)
}