latex/slides.tex
changeset 157 3174d4803cd5
parent 134 73012a0eb878
equal deleted inserted replaced
156:8f4806a1a64d 157:3174d4803cd5
     1 \documentclass[english]{beamer}
     1 \documentclass{beamer}
     2 
     2 \usepackage[latin1]{inputenc}
     3 % generated by Docutils <http://docutils.sourceforge.net/>
       
     4 \usepackage{fixltx2e} % LaTeX patches, \textsubscript
       
     5 \usepackage{cmap} % fix search and cut-and-paste in PDF
       
     6 \usepackage{babel}
       
     7 \usepackage[T1]{fontenc}
     3 \usepackage[T1]{fontenc}
     8 \usepackage[latin1]{inputenc}
     4 \usepackage{fixltx2e}
       
     5 \usepackage{graphicx}
       
     6 \usepackage{longtable}
       
     7 \usepackage{float}
       
     8 \usepackage{wrapfig}
       
     9 \usepackage{soul}
       
    10 \usepackage{textcomp}
       
    11 \usepackage{marvosym}
       
    12 \usepackage{wasysym}
       
    13 \usepackage{latexsym}
       
    14 \usepackage{amssymb}
       
    15 \usepackage{hyperref}
       
    16 \tolerance=1000
       
    17 \usepackage[english]{babel} \usepackage{ae,aecompl}
       
    18 \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
     9 \usepackage{listings}
    19 \usepackage{listings}
    10 \usepackage{amsmath}
       
    11 \lstset{
    20 \lstset{
    12   language=TeX,
    21   language=TeX,
    13   basicstyle=\small\ttfamily,
    22   basicstyle=\ttfamily\bfseries,
    14   commentstyle=\ttfamily\color{blue},
    23   commentstyle=\ttfamily\color{blue},
    15   stringstyle=\ttfamily\color{orange},
    24   stringstyle=\ttfamily\color{orange},
    16   showstringspaces=false,
    25   showstringspaces=false,
    17   breaklines=true,
    26   breaklines=true,
    18   postbreak = \space\dots
    27   postbreak = \space\dots
    19 }
    28 }
    20 
    29 
    21 \usepackage{ifthen}
    30 \newcommand{\typ}[1]{\lstinline{#1}}
    22 \usepackage{longtable}
       
    23 \usepackage{array}
       
    24 \setlength{\extrarowheight}{2pt}
       
    25 \newlength{\DUtablewidth} % internal use in tables
       
    26 
    31 
    27 \mode<presentation>
    32 \mode<presentation>
    28 {
    33 {
    29   \usetheme{Warsaw}
    34   \usetheme{Warsaw}
    30   \useoutertheme{infolines}
    35   \useoutertheme{infolines}
    64 \end{frame}
    69 \end{frame}
    65 
    70 
    66 \section{Introduction}
    71 \section{Introduction}
    67 
    72 
    68 \begin{frame}
    73 \begin{frame}
    69   \frametitle{\LaTeX~- Introduction}
    74   \frametitle{{\LaTeX} - Introduction}
    70   \begin{itemize}
    75   \begin{itemize}
    71   \item Typesetting program
    76   \item Typesetting program
       
    77     \begin{itemize}
       
    78     \item What is typesetting?
       
    79     \end{itemize}
    72   \item Excellently Typeset Documents - specially Math
    80   \item Excellently Typeset Documents - specially Math
    73   \item Anything from one page articles to books. 
    81   \item Anything from one page articles to huge books
    74   \item Based on \TeX
    82   \item Pronounced \emph{Lah-tech} or \emph{Lay-tech}
    75   \item Pronounced ``Lah-tech'' or ``Lay-tech''
       
    76   \end{itemize}
    83   \end{itemize}
    77 \end{frame}
    84 \end{frame}
    78 
    85 
    79 \begin{frame}
    86 \begin{frame}
    80   \frametitle{This Course}
    87   \frametitle{Why \LaTeX?}
    81   \begin{itemize}
    88   \begin{itemize}
    82   \item Look at Sample document - \texttt{sample.pdf}
    89   \item Excellent visual quality! 
       
    90   \item Handles the typesetting; Lets you focus on content
       
    91   \item Makes writing math extremely simple
       
    92   \item It is a standard -- widely used in Scientific community
       
    93   \end{itemize}
       
    94   \begin{block}{}
       
    95     \[\tilde{N}_{\mathbf{x}}\times \mathbf{r}(\mathbf{x}) f_{1k}(\mathbf{x},t) - \frac{1}{2} \tilde{N} \tilde{N}:\mathbf{BB}^{T}P(\mathbf{x},t) = -m_{k}f_{1k}(\mathbf{x},t) + 2 \mathop{\mathbf{\aa}}_{j=1}^{K} f_{1j}(\mathbf{x},t)m_{j}P_{k|j} \]
       
    96   \end{block}
       
    97 \end{frame}
       
    98 
       
    99 \begin{frame}
       
   100   \frametitle{Course Outline}
       
   101   \begin{itemize}
       
   102   \item Look at Sample document - \typ{sample.pdf}
       
   103     \begin{itemize}
       
   104     \item Title, Author, Date
       
   105     \item Abstract
       
   106     \item Sections \& Subsections
       
   107     \item Appendix
       
   108     \item References/Bibliography
       
   109     \item Tables
       
   110     \item Figures
       
   111     \item Math
       
   112     \end{itemize}
    83   \item The document will be produced by the end of the course. 
   113   \item The document will be produced by the end of the course. 
    84   \item First Hour - Basic Structure
   114   \item First Hour - Basic Structure
    85   \item Second Hour - Text, Tables, Figures, References
   115   \item Second Hour - Text, Tables, Figures, References
    86   \item Third Hour - Math, Bibliography, Presentations
   116   \item Third Hour - Math, Bibliography, Presentations
    87   \end{itemize}
   117   \end{itemize}
    88 \end{frame}
   118 \end{frame}
    89 
   119 
    90 
   120 \begin{frame}[fragile]{{\LaTeX}{is awesome}
    91 \begin{frame}
   121   \begin{itemize}
    92   \frametitle{A Look at the Sample Document}
   122   \item {\LaTeX} is a document based mark-up
    93   \begin{itemize}
       
    94   \item Title, Author, Date
       
    95   \item Abstract
       
    96   \item Sections
       
    97   \item Subsections
       
    98   \item Appendix
       
    99   \item References/Bibliography
       
   100   \item Tables
       
   101   \item Figures
       
   102   \item Math
       
   103   \end{itemize}
       
   104 \end{frame}
       
   105 
       
   106 \begin{frame}[fragile]
       
   107   \frametitle{The source \& compilation}
       
   108   Write the following code into the file \texttt{draft.tex}.
       
   109   \begin{lstlisting}
       
   110     \documentclass{article}
       
   111     \begin{document}
       
   112     SciPy is open-source software for mathematics, 
       
   113     science, and engineering.   
       
   114     \end{document}
       
   115   \end{lstlisting}
       
   116   To compile the document, do the following in your terminal: 
       
   117   \begin{lstlisting}[language=bash]
       
   118     $ pdflatex draft.tex
       
   119   \end{lstlisting}
       
   120   This produces the output file \texttt{draft.pdf} %%$
       
   121   Note: \texttt{latex} command is often used to get \texttt{dvi}
       
   122   output. Throughout this course, we shall use \texttt{pdflatex} to
       
   123   compile our documents to \texttt{pdf} output.
       
   124 \end{frame}  
       
   125 
       
   126 \section{Structure of the Document}
       
   127 
       
   128 \begin{frame}[fragile]
       
   129   \frametitle{\lstinline+documentclass+}
       
   130   \begin{itemize}
       
   131   \item \LaTeX~typesets based on \lstinline{documentclass}
       
   132   \item Defines structure and formatting of a document
       
   133   \item \LaTeX~is a document based mark-up
       
   134   \item Mark-up --- a system of annotating text, adding extra
   123   \item Mark-up --- a system of annotating text, adding extra
   135     information to specify structure and presentation of text
   124     information to specify structure and presentation of text
   136   \item Document based markup $\rightarrow$ you don't have to worry
   125   \item Document based markup $\rightarrow$ you don't have to worry
   137     about each element individually 
   126     about each element individually 
   138   \item Allows you to focus on content, rather than appearance.
   127   \item Allows you to focus on content, rather than appearance.
   139   \end{itemize}
   128   \end{itemize}
   140 \end{frame}
   129 \end{frame}
   141 
   130 
   142 \begin{frame}[fragile]
   131 \begin{frame}[fragile]
   143   \frametitle{Environments and Commands}
   132   \frametitle{Typesetting a minimal document}
   144   \lstinline{document} is an environment, present in every document. 
   133   \begin{itemize}
   145   \begin{itemize}
   134   \item Write the sample code  code into the file \typ{draft.tex}\\
   146   \item Environments
   135       {\tiny See \typ{hg} rev0 of draft}
       
   136   \item   To compile, (in terminal) \\
       
   137     \begin{lstlisting}[language=bash]
       
   138       $ pdflatex draft.tex
       
   139     \end{lstlisting} %%$
       
   140   \item This produces the output file \typ{draft.pdf} 
       
   141   \item \alert{Note:} \typ{latex} vs. \typ{pdflatex} 
       
   142   \end{itemize}
       
   143 \end{frame}  
       
   144 
       
   145 \begin{frame}[fragile]
       
   146   \frametitle{Commands \& Environments}
       
   147   \begin{itemize}
       
   148   \item {\LaTeX} is case sensitive
       
   149   \item Commands begin with a \typ{\\}
       
   150   \item Environments have a \typ{\\begin} and \typ{\\end} 
       
   151   \item Any content after the \typ{\\end\{document\}} is ignored
       
   152   \end{itemize}
       
   153 \end{frame}  
       
   154 
       
   155 \newline \\
       
   156 \newpage 
       
   157 
       
   158 
       
   159 \begin{frame}[fragile]
       
   160   \frametitle{Comments \& Special Characters}
       
   161   \begin{itemize}
       
   162   \item Anything that follows a \typ{\%} symbol till end of the line
       
   163     is a comment 
       
   164   \item Special characters (\typ{\~ \# \$ \^ \& \_ \{ \}}) are escaped by a
       
   165     \typ{\\} 
       
   166   \item \typ{\\} symbol is inserted using \typ{\\textbackslash}
       
   167     command
       
   168   \end{itemize}
       
   169 \end{frame}  
       
   170 
       
   171 \begin{frame}[fragile]
       
   172   \frametitle{Spacing}
       
   173   \begin{itemize}
       
   174   \item \typ{\\\\} inserts a new line in the output
       
   175   \item An empty line marks the beginning of a new paragraph
       
   176   \item Multiple spaces (or empty lines) are equivalent to a single
       
   177     space (or empty line)
       
   178   \end{itemize}
       
   179 \end{frame}  
       
   180 
       
   181 \section{Adding Structure}
       
   182 
       
   183 \begin{frame}[fragile]
       
   184   \frametitle{\typ{documentclass}}
       
   185   \begin{itemize}
       
   186   \item Used to select the \emph{class} of our document
       
   187   \item Some available classes - \typ{article}, \typ{proc},
       
   188     \typ{report}, \typ{book}, \typ{slides}, \typ{letter}.
       
   189    \item For example:
       
   190     \typ{\\documentclass\[12pt,a4paper,draft\]\{report\}}\\
       
   191     The parameters within \typ{\[ \]} are optional.
   147     \begin{itemize}
   192     \begin{itemize}
   148     \item \lstinline{\begin} and \lstinline{\end} define the beginning
   193     \item \typ{12pt} -- sets the font size of main font and others are
   149       and end of an environment
   194       relatively, adjusted. \typ{10pt} is the default. 
   150     \item All the content of the document is placed inside the
   195     \item \typ{a4paper} -- specify paper size
   151       \lstinline{document} environment 
   196     \item \typ{draft} -- marks hyphenation and justification problems in
       
   197       typesetting with a square in the margin
   152     \end{itemize}
   198     \end{itemize}
   153   \item Commands
   199 
   154     \begin{itemize}
   200   \end{itemize}
   155     \item All commands begin with \textbackslash
   201 \end{frame}
   156     \item They are case-sensitive
       
   157     \item Only alpha caracthers; other characters terminate commands
       
   158     \end{itemize}
       
   159   \end{itemize}
       
   160 \end{frame}
       
   161 
       
   162 
   202 
   163 \begin{frame}[fragile]
   203 \begin{frame}[fragile]
   164   \frametitle{Top Matter}
   204   \frametitle{Top Matter}
   165   Let's add the Title, Author's name and the date to the document.
   205   Let's add the title, author's name and the date.
   166   \begin{itemize}
   206   \begin{itemize}
   167   \item Add title, author and date. Compile. Nothing changes.
   207   \item Add title, author and date. 
   168   \end{itemize}
   208   \item Compile. 
   169   \begin{lstlisting}
   209   \item Nothing changes.
   170     \title{A Glimpse at Scipy}
   210   \end{itemize}
   171     \author{FOSSEE}
   211   {\tiny See \typ{hg} rev1 of draft.}
   172     \date{June 2010}
       
   173   \end{lstlisting}
       
   174   \tiny{See \texttt{hg} rev1 of draft.}
       
   175 \end{frame}
   212 \end{frame}
   176 
   213 
   177 \begin{frame}[fragile]
   214 \begin{frame}[fragile]
   178   \frametitle{Top Matter \ldots}
   215   \frametitle{Top Matter \ldots}
   179   \begin{itemize}
   216   \begin{itemize}
   180   \item \lstinline{\maketitle} command inserts the top-matter.
   217   \item \lstinline{\maketitle} command inserts the top-matter.
   181   \item Compile again. 
   218   \item Add the command to the document \& compile again. 
   182   \item If no date is specified, today's date is automatically
   219   \item If no date is specified, today's date is automatically
   183     inserted.
   220     inserted.
   184   \end{itemize}
   221   \end{itemize}
   185   \begin{lstlisting}
   222   \tiny{See \typ{hg} rev2 of draft.}
   186     \begin{document}
       
   187     \maketitle
       
   188     SciPy is open-source software for mathematics, science, and engineering.   
       
   189     \end{document}
       
   190    \end{lstlisting}
       
   191   \tiny{See \texttt{hg} rev2 of draft.}
       
   192 \end{frame}
   223 \end{frame}
   193 
   224 
   194 
   225 
   195 \begin{frame}[fragile]
   226 \begin{frame}[fragile]
   196   \frametitle{Abstract}
   227   \frametitle{Abstract}
   197   \begin{itemize}
   228   \begin{itemize}
   198   \item The abstract environment is placed at the location where it's
   229   \item \typ{\\abstract} environment inserts abstract.
   199     put in the source. 
   230   \item Place it at the location where you want your abstract. 
   200   \end{itemize}
   231   \end{itemize}
   201   \begin{lstlisting}
   232   \tiny See rev3 of \typ{hg}
   202     \begin{abstract}
       
   203       This document shows a glimpse of the features of Scipy that will
       
   204       be explored during this course.
       
   205     \end{abstract}
       
   206   \end{lstlisting}
       
   207   \tiny See rev3 of \texttt{hg}
       
   208 \end{frame}
   233 \end{frame}
   209 
   234 
   210 \begin{frame}[fragile]
   235 \begin{frame}[fragile]
   211   \frametitle{Sectioning}
   236   \frametitle{Sectioning}
   212   \begin{itemize}
   237   \begin{itemize}
   213   \item \lstinline{\section}, \lstinline{\subsection}
   238   \item \lstinline{\section}, \lstinline{\subsection}
   214     \lstinline{\subsubsection}
   239     \lstinline{\subsubsection}
   215   \item Auto numbered sections!
   240   \item Auto numbered sections!
   216   \item \* to prevent numbering of a section
   241   \item \typ{*} to prevent numbering of a section
   217   \end{itemize}
   242   \end{itemize}
   218   \begin{lstlisting}
   243   \tiny See rev4 of \typ{hg}
   219     \section{A Glimpse of Scipy functions}
       
   220     \subsection{Matrix Operations}
       
   221     \subsubsection{Inverse}
       
   222   \end{lstlisting}
       
   223   \tiny See rev4 of \texttt{hg}
       
   224 \end{frame}
   244 \end{frame}
   225 
   245 
   226 \begin{frame}[fragile]
   246 \begin{frame}[fragile]
   227   \frametitle{Sectioning \ldots}
   247   \frametitle{Sectioning \ldots}
   228   \begin{itemize}
   248   \begin{itemize}
   240   \item Change \lstinline{secnumdepth}
   260   \item Change \lstinline{secnumdepth}
   241   \end{itemize}
   261   \end{itemize}
   242   \begin{lstlisting}
   262   \begin{lstlisting}
   243     \setcounter{secnumdepth}{3}
   263     \setcounter{secnumdepth}{3}
   244   \end{lstlisting}
   264   \end{lstlisting}
   245    \tiny See rev5 of \texttt{hg}
   265    \tiny See rev5 of \typ{hg}
   246 \end{frame}
   266 \end{frame}
   247 
   267 
   248 \begin{frame}[fragile]
   268 \begin{frame}[fragile]
   249   \frametitle{Appendices}
   269   \frametitle{Appendices}
   250   \begin{itemize}
   270   \begin{itemize}
   251   \item Anything following the \lstinline{\appendix} command is added
   271   \item \lstinline{\appendix} command indicates the beginning of
   252     to the Appendix. 
   272     Appendices. 
   253   \end{itemize}
   273   \item Any content after \lstinline{\appendix}, will be added to the
   254   \begin{lstlisting}
   274     appendix 
   255     \appendix
   275   \item Use sectioning commands to add sections
   256     
   276   \end{itemize}
   257     \section{Plotting using Pylab}
   277   \tiny See rev7 of \typ{hg}
   258   \end{lstlisting}
       
   259   \tiny See rev7 of \texttt{hg}
       
   260 \end{frame}
   278 \end{frame}
   261 
   279 
   262 \begin{frame}[fragile]
   280 \begin{frame}[fragile]
   263   \frametitle{Table of Contents [TOC]}
   281   \frametitle{Table of Contents [TOC]}
   264   \begin{itemize}
   282   \begin{itemize}
   269   \item Only headings appear. No page numbers. 
   287   \item Only headings appear. No page numbers. 
   270   \item A \lstinline{.toc} file is generated. 
   288   \item A \lstinline{.toc} file is generated. 
   271   \item Re-compile.
   289   \item Re-compile.
   272   \item Any numbered section/block automatically appears
   290   \item Any numbered section/block automatically appears
   273   \end{itemize}
   291   \end{itemize}
   274   \tiny See rev8 of \texttt{hg}
   292   \tiny See rev8 of \typ{hg}
   275 \end{frame}
   293 \end{frame}
   276 
   294 
   277 \begin{frame}[fragile]
   295 \begin{frame}[fragile]
   278   \frametitle{TOC \ldots}
   296   \frametitle{TOC \ldots}
   279   \begin{itemize}
   297   \begin{itemize}
   280   \item To add un-numbered sections, use \lstinline{\addcontentsline}
   298   \item Un-numbered sections are added to TOC using
   281   \end{itemize}
   299     \lstinline{\addcontentsline}
   282   \begin{lstlisting}
   300   \item For instance,  \lstinline+\addcontentsline{toc}{section}{Intro}+
   283     \section*{Introduction}
   301   \end{itemize}
   284     \addcontentsline{toc}{section}{Intro}
   302   \tiny See rev9 of \typ{hg}
   285   \end{lstlisting}
       
   286   \tiny See rev9 of \texttt{hg}
       
   287 \end{frame}
   303 \end{frame}
   288 
   304 
   289 \begin{frame}
   305 \begin{frame}
   290   \frametitle{Bibliography}
   306   \frametitle{Bibliography}
   291   We shall look at Bibliographies, later in the course. 
   307   We shall look at Bibliographies, later in the course. 
   292 \end{frame}
   308 \end{frame}
   293 
   309 
   294 \section{Typesetting Text}
   310 \section{Typesetting Text}
   295 \begin{frame}[fragile]
   311 \begin{frame}[fragile]
   296   \frametitle{Line breaks, Paragraphs}
       
   297   \begin{itemize}
       
   298   \item Add the text of second paragraph in the introduction section. 
       
   299   \item Compile. 
       
   300   \item An empty line starts a new para
       
   301   \item New paragraphs are indented
       
   302   \item Multiple spaces or empty lines are considered as one
       
   303   \item To start a new line \lstinline{\\} or \lstinline{\newline}
       
   304   \end{itemize}
       
   305   \tiny See rev10 of \texttt{hg}
       
   306 \end{frame}
       
   307 
       
   308 \begin{frame}[fragile]
       
   309   \frametitle{Quotation Marks}
   312   \frametitle{Quotation Marks}
   310   \begin{itemize}
   313   \begin{itemize}
   311   \item The quotation marks around Sigh Pie are not formatted properly
       
   312   \item Use \`~ (accent) for left quote
   314   \item Use \`~ (accent) for left quote
   313   \item Use \'~ (apostrophe) for right quote
   315   \item Use \'~ (apostrophe) for right quote
   314   \item For double quotes, use them twice
   316   \item For double quotes, use them twice
   315   \end{itemize}
   317   \end{itemize}
   316   \begin{center}
   318   \tiny See rev11 of \typ{hg}
   317     \`~\`~Sigh Pie\'~\'~
       
   318   \end{center}
       
   319   \tiny See rev11 of \texttt{hg}
       
   320 \end{frame}
   319 \end{frame}
   321 
   320 
   322 \begin{frame}[fragile]
   321 \begin{frame}[fragile]
   323   \frametitle{Fonts - Emphasis, Fixed width, \ldots}
   322   \frametitle{Fonts - Emphasis, Fixed width, \ldots}
   324   \begin{itemize}
   323   \begin{itemize}
   325   \item \lstinline{\emph} gives emphasized or italic text
   324   \item \lstinline{\emph} gives emphasized or italic text
   326   \item \LaTeX environments can be nested
   325   \item \typ{flushleft} to have text left aligned
   327   \item Let's add sub-package names as text, before learning to
   326   \item \typ{flushright}, \typ{center}
   328     typeset tables
   327   \end{itemize}
   329   \item Note multiple spacing won't work
   328   \tiny See rev12 of \typ{hg}
   330   \end{itemize}
       
   331   \begin{lstlisting}
       
   332     Subpackage - Description\\
       
   333     cluster - Clustering algorithms\\
       
   334     constants - Physical and mathematical constants\\
       
   335     fftpack - Fast Fourier Transform routines\\
       
   336   \end{lstlisting}
       
   337   \begin{center}
       
   338     \hspace{1in}\vdots
       
   339   \end{center}
       
   340   \tiny See rev12 of \texttt{hg}
       
   341 \end{frame}
   329 \end{frame}
   342 
   330 
   343 \begin{frame}[fragile]
   331 \begin{frame}[fragile]
   344   \frametitle{Fonts - Emphasis, Fixed width, \ldots}
   332   \frametitle{Fonts - Emphasis, Fixed width, \ldots}
   345   \begin{itemize}
   333   \begin{itemize}
   346   \item Use \lstinline{\texttt} for sub-packages names - fixed width
   334   \item \lstinline{\texttt} gives fixed width font
   347   \item \lstinline{\textbf} for bold face
   335   \item \lstinline{\textbf} bold face font
   348   \item \lstinline{-} can be replaced with \lstinline{--} or
   336   \item \lstinline{--} en dash (--); \lstinline{---} em dash (---). 
   349     \lstinline{---} for better formatting
   337   \end{itemize}
   350   \end{itemize}
   338   \tiny See rev13 of \typ{hg}
   351   \begin{lstlisting}
   339 \end{frame}
   352     \textbf{Subpackage} --- \textbf{Description}\\
   340 
   353     \texttt{cluster} --- Clustering algorithms\\
       
   354     \texttt{constants} --- Physical and mathematical constants\\
       
   355     \texttt{fftpack} --- Fast Fourier Transform routines\\
       
   356   \end{lstlisting}
       
   357   \begin{center}
       
   358     \hspace{1in}\vdots
       
   359   \end{center}
       
   360   \tiny See rev13 of \texttt{hg}
       
   361 \end{frame}
       
   362 
       
   363 \subsection{Lists}
       
   364 \begin{frame}[fragile]
   341 \begin{frame}[fragile]
   365   \frametitle{Lists}
   342   \frametitle{Lists}
   366   \begin{itemize}
   343   \begin{itemize}
   367   \item \lstinline{enumerate} environment is used for numbered lists
   344   \item \lstinline{enumerate} environment is used for numbered lists
   368   \item \lstinline{itemize} environment gives un-numbered lists
   345   \item \lstinline{itemize} environment gives un-numbered lists
   369   \item Each item in the list is specified using \lstinline{\item}
   346   \item Each item in the list is specified using \lstinline{\item}
   370   \item Nested lists are also easily handled, as expected
   347   \item Nested lists are also easily handled, as expected
   371   \item Example on next slide
   348   \end{itemize}
   372   \end{itemize}
   349   \tiny See rev14 of \typ{hg}
   373   \tiny See rev14 of \texttt{hg}
       
   374 \end{frame}
       
   375 
       
   376 \begin{frame}[fragile]
       
   377   \frametitle{Lists \ldots}
       
   378   \begin{lstlisting}
       
   379     \begin{enumerate}
       
   380     \item Plotting
       
   381     \item Matrix Operations
       
   382       \begin{itemize}
       
   383       \item Inverse
       
   384       \end{itemize}
       
   385     \item Solving Equations
       
   386       \begin{itemize}
       
   387       \item System of Linear equations
       
   388       \end{itemize}
       
   389     \item Integration 
       
   390       \begin{itemize}
       
   391       \item Quadrature
       
   392       \item ODEs
       
   393       \end{itemize}
       
   394     \end{enumerate}
       
   395   \end{lstlisting}
       
   396 \end{frame}
   350 \end{frame}
   397 
   351 
   398 \begin{frame}[fragile]
   352 \begin{frame}[fragile]
   399   \frametitle{Footnotes}
   353   \frametitle{Footnotes}
   400   \begin{itemize}
   354   \begin{itemize}
   401   \item Add footnote for \lstinline{pylab}
   355   \item \typ{\\footnote} command adds a footnote
   402   \item It's easily done using \lstinline{\footnote} command 
   356   \end{itemize}
   403   \end{itemize}
   357   \tiny See rev15 of \typ{hg}
   404   \begin{lstlisting}
       
   405     Plotting \footnote{using \texttt{pylab} - see Appendix A} 
       
   406   \end{lstlisting}
       
   407   \begin{itemize}
       
   408   \item We have just written down the name of the appendix
       
   409   \item But if another section is added before it, the reference has
       
   410     to be changed
       
   411   \item \LaTeX provides labels and references
       
   412   \end{itemize}
       
   413   \tiny See rev15 of \texttt{hg}
       
   414 \end{frame}
   358 \end{frame}
   415 
   359 
   416 \begin{frame}[fragile]
   360 \begin{frame}[fragile]
   417   \frametitle{Labels and References}
   361   \frametitle{Labels and References}
   418   \begin{itemize}
   362   \begin{itemize}
   419   \item First add a label to the section that we wish to refer to
   363   \item \lstinline+\label{labelname}+ is used to label an element
   420   \item \lstinline+\label{labelname}+
   364   \item \lstinline+\ref{labelname}+ is used to refer to that element
   421   \item Change footnote to use the reference
       
   422   \item \lstinline+\ref{labelname}+
       
   423   \item Compile twice
   365   \item Compile twice
   424   \end{itemize}
   366   \end{itemize}
   425   \begin{lstlisting}
   367   \tiny See rev15 of \typ{hg}
   426     \section{Plotting using Pylab}\label{mpl}
       
   427 
       
   428     Plotting \footnote{using \texttt{pylab} - see Appendix \ref{mpl}} 
       
   429   \end{lstlisting}
       
   430   \tiny See rev15 of \texttt{hg}
       
   431 \end{frame}
   368 \end{frame}
   432 
   369 
   433 \begin{frame}[fragile]
   370 \begin{frame}[fragile]
   434   \frametitle{Including code}
   371   \frametitle{Including code}
   435   \begin{itemize}
   372   \begin{itemize}
   436   \item Instead of using \lstinline{\texttt} we could use
   373   \item Instead of using \lstinline{\texttt} we could use
   437     \lstinline{\verbatim} 
   374     \lstinline{\verbatim} 
   438   \item \lstinline{listings} is a powerful package
   375   \item \lstinline+\lstinline{listings}+ is a powerful package
   439   \item \lstinline+\usepackage{listings}+ needs to be added 
   376   \item \lstinline+\usepackage{listings}+ needs to be added 
   440   \item Tell \LaTeX the language, you are going to use
   377   \item Tell {\LaTeX} the language to be used, using \typ{\\lstset}
   441   \end{itemize}
   378   \end{itemize}
   442   \begin{lstlisting}
   379   \tiny See rev16 of \typ{hg}
   443     \usepackage{listings} 
       
   444     \lstset{language=Python,
       
   445       basicstyle=\ttfamily\bfseries,
       
   446       showstringspaces=false}
       
   447   \end{lstlisting}
       
   448   \tiny See rev16 of \texttt{hg}
       
   449 \end{frame}
   380 \end{frame}
   450 
   381 
   451 \begin{frame}[fragile]
   382 \begin{frame}[fragile]
   452   \frametitle{Including code}
   383   \frametitle{Including code}
   453   \begin{itemize}
   384   \begin{itemize}
   454   \item Use \lstinline{lstlisting} for a block of code
   385   \item Use \lstinline+\lstlisting+ for a block of code
   455   \item \lstinline+\lstinline+ for inline code
   386   \item \typ{\\lstinline} for inline code
   456   \item Let's add the code to Appendix
   387   \end{itemize}
   457   \end{itemize}
   388   \tiny See rev16 of \typ{hg}
   458   \begin{lstlisting}
       
   459     \begin{lstlisting.}
       
   460       In []: x = linspace(0, 2*pi, 50)
       
   461       In []: plot(x, sin(x))
       
   462       In []: title('Sine Curve between 0 and $\pi$')
       
   463       In []: legend(['sin(x)'])
       
   464     \end{lstlisting.}
       
   465   \end{lstlisting}
       
   466   \tiny See rev16 of \texttt{hg}
       
   467 \end{frame}
   389 \end{frame}
   468 
   390 
   469 \section{Figures, Tables \& Floats}
   391 \section{Figures, Tables \& Floats}
   470 \begin{frame}[fragile]
   392 \begin{frame}[fragile]
   471   \frametitle{Figures}
   393   \frametitle{Figures}
   472   \begin{itemize}
   394   \begin{itemize}
   473   \item Let's add the figure in the Appendix
   395   \item The \typ{graphicx} package allows us to insert graphics
   474   \item \lstinline+\usepackage{graphicx}+
   396   \item \lstinline+\usepackage{graphicx}+
   475   \item To add a graphic, use \lstinline{\includegraphics} command
   397   \item To add a graphic, use \lstinline{\includegraphics} command
   476   \item We give the relative path to the \lstinline+.png+ image
   398   \item Use relative path to the image
   477   \end{itemize}
   399   \end{itemize}
   478   \begin{lstlisting}
   400   \tiny See rev17 of \typ{hg}
   479     \usepackage{graphicx}
       
   480     
       
   481     \begin{figure}[h!]
       
   482     \begin{center}
       
   483       \includegraphics[scale=0.4]{../sine.png}      
       
   484     \end{center}
       
   485     \caption{Sine Curve}
       
   486     \label{fig:sin}
       
   487     \end{figure}
       
   488   \end{lstlisting}
       
   489 
       
   490   \tiny See rev17 of \texttt{hg}
       
   491 \end{frame}
   401 \end{frame}
   492 
   402 
   493 \begin{frame}[fragile]
   403 \begin{frame}[fragile]
   494   \frametitle{\lstinline{includgraphics}}
   404   \frametitle{\lstinline{includgraphics}}
   495   It takes following optional arguments
   405   It takes following optional arguments
   536   \begin{itemize}
   446   \begin{itemize}
   537   \item Figure environment allows us add a caption
   447   \item Figure environment allows us add a caption
   538   \item To place the image in the center we enclose it in the
   448   \item To place the image in the center we enclose it in the
   539     \lstinline+center+ environment 
   449     \lstinline+center+ environment 
   540   \item We can label images too
   450   \item We can label images too
   541   \item label shoule be added after the caption command
   451   \item label should be added after the caption command
   542   \item Figures are auto numbered
   452   \item Figures are auto numbered
   543   \end{itemize}
   453   \end{itemize}
   544   \tiny See rev17 of \texttt{hg}
   454   \tiny See rev17 of \typ{hg}
   545 \end{frame}
   455 \end{frame}
   546 
       
   547 \subsection{Tables}
       
   548 
   456 
   549 \begin{frame}[frame]
   457 \begin{frame}[frame]
   550   \frametitle{Tables}
   458   \frametitle{Tables}
   551   \begin{itemize}
   459   \begin{itemize}
   552   \item \lstinline+tabular+ is used to typeset a table
   460   \item \lstinline+tabular+ is used to typeset a table
   581     for center 
   489     for center 
   582   \item each column of table is separated by \&
   490   \item each column of table is separated by \&
   583   \item each row is separated by newline \lstinline{\\}
   491   \item each row is separated by newline \lstinline{\\}
   584   \item \lstinline+\hline+ give a horizontal line between two rows
   492   \item \lstinline+\hline+ give a horizontal line between two rows
   585   \end{itemize}
   493   \end{itemize}
   586   \tiny See rev18 of \texttt{hg}
   494   \tiny See rev18 of \typ{hg}
   587 \end{frame}
       
   588 
       
   589 \begin{frame}[fragile]
       
   590   \frametitle{\lstinline+tabular+ \ldots}
       
   591   \begin{lstlisting}
       
   592     \begin{table}
       
   593       \caption{Sub-packages available in Scipy}
       
   594       \label{subpkg}
       
   595       \begin{tabular}{|l|l|}
       
   596         \hline
       
   597         \textbf{Subpackage} & \textbf{Description}\\
       
   598         \texttt{constants} & Physical and mathematical constants\\
       
   599         \hline
       
   600         \texttt{fftpack} & Fast Fourier Transform routines\\
       
   601         \hline
       
   602         \end{tabular}
       
   603       \end{table}
       
   604     \end{lstlisting}
       
   605 \end{frame}
   495 \end{frame}
   606 
   496 
   607 \begin{frame}[fragile]
   497 \begin{frame}[fragile]
   608   \frametitle{List of Tables, Figures}
   498   \frametitle{List of Tables, Figures}
   609   \begin{itemize}
   499   \begin{itemize}
   610   \item \lstinline+listoftables+
   500   \item \lstinline+\listoftables+ -- to add a list of tables
   611   \item \lstinline+listoffigures+
   501   \item \lstinline+\listoffigures+ -- to add a list of figures
   612   \end{itemize}
   502   \end{itemize}
   613 \end{frame}
   503 \end{frame}
   614 
   504 
   615 
   505 
   616 \section{Typesetting Math}
   506 \section{Typesetting Math}
   617 \begin{frame}[fragile]
   507 \begin{frame}[fragile]
   618   \frametitle{Math in \LaTeX}
   508   \frametitle{Math in \LaTeX}
   619   \begin{itemize}
   509   \begin{itemize}
   620   \item Math is enclosed in a pair of \lstinline{$} signs o
   510   \item Math is enclosed in a pair of \lstinline{$} signs of %%$
   621     \lstinline+\(  \)+ %$
   511     \lstinline+\(  \)+ 
   622   \item Used for typesetting inline Math. 
   512   \item Used for typesetting inline Math. 
   623   \item \lstinline+\usepackage{amsmath}+
   513   \item \lstinline+\usepackage{amsmath}+
   624   \item Let's now move on to matrices. 
   514   \item Let's now move on to matrices. 
   625   \end{itemize}
   515   \end{itemize}
   626 \end{frame}
   516 \end{frame}
   630   \begin{itemize}
   520   \begin{itemize}
   631   \item \lstinline+\bmatrix+ is used to typeset the matrix A
   521   \item \lstinline+\bmatrix+ is used to typeset the matrix A
   632   \item It works similar to ta tabular environment
   522   \item It works similar to ta tabular environment
   633   \item \lstinline+&+ for demarcating columns
   523   \item \lstinline+&+ for demarcating columns
   634   \item \lstinline+\\+ for demwarcating rows
   524   \item \lstinline+\\+ for demwarcating rows
   635   \end{itemize}
   525   \item Other matrix environments
   636   \begin{lstlisting}
       
   637     Let $\mathbf{A}$ be the matrix 
       
   638     \(
       
   639     \begin{bmatrix}
       
   640       1 &3 &5\\
       
   641       2 &5 &1\\
       
   642       2 &3 &8
       
   643     \end{bmatrix}
       
   644     \)
       
   645   \end{lstlisting}
       
   646   \tiny See rev19 of \texttt{hg}    
       
   647 \end{frame}
       
   648 
       
   649 \begin{frame}[fragile]
       
   650   \frametitle{Matrices \ldots}
       
   651   \begin{itemize}
       
   652   \item There are 5 other matrix environments 
       
   653   \end{itemize}
       
   654   \begin{table}
   526   \begin{table}
   655     \center
   527     \center
   656     \begin{tabular}{c|c}
   528     \begin{tabular}{c|c}
   657       \lstinline+matrix+  &  none\\
   529       \lstinline+matrix+  &  none\\
   658       \lstinline+pmatrix+ &  \lstinline+(+\\
   530       \lstinline+pmatrix+ &  \lstinline+(+\\
   659       \lstinline+Bmatrix+ &  \lstinline+{+\\
   531       \lstinline+Bmatrix+ &  \lstinline+{+\\
   660         \lstinline+vmatrix+ &  \lstinline+|+\\  
   532         \lstinline+vmatrix+ &  \lstinline+|+\\  
   661         \lstinline+Vmatrix+ &  \lstinline+||+
   533         \lstinline+Vmatrix+ &  \lstinline+||+
   662     \end{tabular}
   534     \end{tabular}
   663   \end{table}
   535   \end{table}
       
   536   \end{itemize}
       
   537   \tiny See rev19 of \typ{hg}    
   664 \end{frame}
   538 \end{frame}
   665 
   539 
   666 \begin{frame}[fragile]
   540 \begin{frame}[fragile]
   667   \frametitle{Superscripts \& Subscripts}
   541   \frametitle{Superscripts \& Subscripts}
   668   \begin{itemize}
   542   \begin{itemize}
   669   \item \lstinline+^+ for superscripts
   543   \item \lstinline+^+ for superscripts
   670   \item To have multiple characters as sub/superscript, enclose in
       
   671     \lstinline+{ }+
       
   672   \item \lstinline+_+ for subscripts
   544   \item \lstinline+_+ for subscripts
       
   545   \item Enclose multiple characters in \lstinline+{ }+
   673   \end{itemize}
   546   \end{itemize}
   674 \end{frame}
   547 \end{frame}
   675 
   548 
   676 \begin{frame}[fragile]
   549 \begin{frame}[fragile]
   677   \frametitle{Summation \& integration}
   550   \frametitle{Summation \& integration}
   685 \end{frame}
   558 \end{frame}
   686 
   559 
   687 \begin{frame}[fragile]
   560 \begin{frame}[fragile]
   688   \frametitle{\lstinline+displayed+ math}
   561   \frametitle{\lstinline+displayed+ math}
   689   \begin{itemize}
   562   \begin{itemize}
   690   \item The equation in Determinants section is different. 
   563   \item Display equations are the other type of displaying math
   691   \item It is a displayed equation. 
       
   692   \item \LaTeX~ or \lstinline+amsmath+ has a number of environments
   564   \item \LaTeX~ or \lstinline+amsmath+ has a number of environments
   693     for ``displaying'' equations, with minor differences. 
   565     for ``displaying'' equations, with minor differences. 
   694   \item In general, enclose math in \lstinline+\[+ and \lstinline+\]+
   566   \item In general, enclose math in \lstinline+\[+ and \lstinline+\]+
   695     to get displayed math. 
   567     to get displayed math. 
   696   \item \lstinline+\begin*{equation}+ is equivalent to this.
   568   \item \lstinline+\begin{equation*}+ is equivalent to this.
   697   \item Use \lstinline+\begin{equation}+ to get numbered
   569   \item Use \lstinline+\begin{equation}+ to get numbered
   698     equations. %%\end{equation} 
   570     equations. %%\end{equation} 
   699   \end{itemize}
   571   \end{itemize}
   700   \begin{lstlisting}
   572   \tiny See rev20 of \typ{hg}    
   701     \[ \left|\mathbf{A}\right|=\sum_{j}\left(-1\right)^{i+j}a_{ij}\mathbf{M}_{ij} \]
       
   702   \end{lstlisting}
       
   703   \tiny See rev20 of \texttt{hg}    
       
   704 \end{frame}
   573 \end{frame}
   705 
   574 
   706 \begin{frame}[fragile]
   575 \begin{frame}[fragile]
   707   \frametitle{Groups of equations}
   576   \frametitle{Groups of equations}
   708   \begin{itemize}
   577   \begin{itemize}
   712   \item It is similar to the \lstinline+table+ environment
   581   \item It is similar to the \lstinline+table+ environment
   713   \item The parts of the equation that need to be aligned are
   582   \item The parts of the equation that need to be aligned are
   714     indicated using \& symbol.
   583     indicated using \& symbol.
   715   \item Each equation is separated by a \lstinline+\newline+ command
   584   \item Each equation is separated by a \lstinline+\newline+ command
   716   \end{itemize}
   585   \end{itemize}
   717   \begin{lstlisting}
   586   \tiny See rev21, 22 of \typ{hg}    
   718     \begin{eqnarray*}
       
   719       x^3 - 2x^2 - \frac{1}{2}x + 1 = 0\\
       
   720       x^2(x-2) - \frac{1}{2}(x-2) = 0\\
       
   721       (x-2)(x^2 - \frac{1}{2}) = 0\\
       
   722       (x-2)(x - \frac{1}{\sqrt{2}})(x + \frac{1}{\sqrt{2}}) = 0
       
   723     \end{eqnarray*}    
       
   724   \end{lstlisting}
       
   725   \tiny See rev21, 22 of \texttt{hg}    
       
   726 \end{frame}
   587 \end{frame}
   727 
   588 
   728 \begin{frame}[fragile]
   589 \begin{frame}[fragile]
   729   \frametitle{Fractions \& Surds}
   590   \frametitle{Fractions \& Surds}
   730   \begin{itemize}
   591   \begin{itemize}
   785   \item label replaces auto enumeration numbers 
   646   \item label replaces auto enumeration numbers 
   786   \item \lstinline+\cite{name}+ is used to \lstinline+cite+ the
   647   \item \lstinline+\cite{name}+ is used to \lstinline+cite+ the
   787     \lstinline+bibitem+ 
   648     \lstinline+bibitem+ 
   788   \item You will need to compile twice. 
   649   \item You will need to compile twice. 
   789   \end{itemize}
   650   \end{itemize}
   790 \end{frame}
   651   \tiny See rev23 of \typ{hg}    
   791 
       
   792 \begin{frame}[fragile]
       
   793   \frametitle{Bibliography}
       
   794   \begin{lstlisting}
       
   795     \begin{thebibliography}{9}
       
   796     \bibitem{scipy} 
       
   797       Eric Jones and Travis Oliphant and Pearu Peterson and others,
       
   798       \emph{SciPy: Open source scientific tools for Python}, 2001 -- , 
       
   799       \url{http://www.scipy.org/} 
       
   800   \end{lstlisting}
       
   801   \tiny See rev23 of \texttt{hg}    
       
   802 \end{frame}
   652 \end{frame}
   803 
   653 
   804 \section{Presentations - Beamer}
   654 \section{Presentations - Beamer}
   805 \begin{frame}[fragile]
   655 \begin{frame}[fragile]
   806   \frametitle{Beamer}
   656   \frametitle{Beamer}
   833   \item To achieve more with beamer, it is highly recommended that you
   683   \item To achieve more with beamer, it is highly recommended that you
   834     look at the \texttt{beameruserguide} 
   684     look at the \texttt{beameruserguide} 
   835   \end{itemize}
   685   \end{itemize}
   836 \end{frame}
   686 \end{frame}
   837 
   687 
       
   688 \begin{frame}[fragile]
       
   689   \frametitle{}
       
   690   \begin{center}
       
   691     \Huge{Thank You!}
       
   692   \end{center}
       
   693 \end{frame}
       
   694 
       
   695 
   838 \end{document} 
   696 \end{document} 
   839  
   697