latex/slides.tex
changeset 123 7a16c80c584d
parent 105 bba1ae4ef1ae
child 134 73012a0eb878
equal deleted inserted replaced
122:70b86355e851 123:7a16c80c584d
       
     1 \documentclass[english]{beamer}
       
     2 
       
     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}
       
     8 \usepackage[latin1]{inputenc}
       
     9 \usepackage{listings}
       
    10 \usepackage{amsmath}
       
    11 \lstset{
       
    12   language=TeX,
       
    13   basicstyle=\small\ttfamily,
       
    14   commentstyle=\ttfamily\color{blue},
       
    15   stringstyle=\ttfamily\color{orange},
       
    16   showstringspaces=false,
       
    17   breaklines=true,
       
    18   postbreak = \space\dots
       
    19 }
       
    20 
       
    21 \usepackage{ifthen}
       
    22 \usepackage{longtable}
       
    23 \usepackage{array}
       
    24 \setlength{\extrarowheight}{2pt}
       
    25 \newlength{\DUtablewidth} % internal use in tables
       
    26 
       
    27 \mode<presentation>
       
    28 {
       
    29   \usetheme{Warsaw}
       
    30   \useoutertheme{infolines}
       
    31   \setbeamercovered{transparent}
       
    32 }
       
    33 
       
    34 
       
    35 \title{\LaTeX}
       
    36 \author[FOSSEE] {FOSSEE}
       
    37 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT
       
    38   Bombay}
       
    39 \date{}
       
    40 
       
    41 %% Delete this, if you do not want the table of contents to pop up at
       
    42 %% the beginning of each subsection:
       
    43 \AtBeginSubsection[]
       
    44 {
       
    45   \begin{frame}<beamer>
       
    46     \frametitle{Outline}
       
    47     \tableofcontents[currentsection,currentsubsection]
       
    48   \end{frame}
       
    49 }
       
    50 
       
    51 \AtBeginSection[]
       
    52 {
       
    53   \begin{frame}<beamer>
       
    54     \frametitle{Outline}
       
    55     \tableofcontents[currentsection,currentsubsection]
       
    56   \end{frame}
       
    57 }
       
    58 
       
    59 \begin{document}
       
    60 
       
    61 % Document title
       
    62 \begin{frame}
       
    63   \maketitle  
       
    64 \end{frame}
       
    65 
       
    66 \section{Introduction}
       
    67 
       
    68 \begin{frame}
       
    69   \frametitle{\LaTeX~- Introduction}
       
    70   \begin{itemize}
       
    71   \item Typesetting program
       
    72   \item Excellently Typeset Documents - specially Math
       
    73   \item Anything from one page articles to books. 
       
    74   \item Based on \TeX
       
    75   \item Pronounced ``Lah-tech'' or ``Lay-tech''
       
    76   \end{itemize}
       
    77 \end{frame}
       
    78 
       
    79 \begin{frame}
       
    80   \frametitle{This Course}
       
    81   \begin{itemize}
       
    82   \item Look at Sample document - \texttt{sample.pdf}
       
    83   \item The document will be produced by the end of the course. 
       
    84   \item First Hour - Basic Structure
       
    85   \item Second Hour - Text, Tables, Figures, References
       
    86   \item Third Hour - Math, Bibliography, Presentations
       
    87   \end{itemize}
       
    88 \end{frame}
       
    89 
       
    90 
       
    91 \begin{frame}
       
    92   \frametitle{A Look at the Sample Document}
       
    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
       
   135     information to specify structure and presentation of text
       
   136   \item Document based markup $\rightarrow$ you don't have to worry
       
   137     about each element individually 
       
   138   \item Allows you to focus on content, rather than appearance.
       
   139   \end{itemize}
       
   140 \end{frame}
       
   141 
       
   142 \begin{frame}[fragile]
       
   143   \frametitle{Environments and Commands}
       
   144   \lstinline{document} is an environment, present in every document. 
       
   145   \begin{itemize}
       
   146   \item Environments
       
   147     \begin{itemize}
       
   148     \item \lstinline{\begin} and \lstinline{\end} define the beginning
       
   149       and end of an environment
       
   150     \item All the content of the document is placed inside the
       
   151       \lstinline{document} environment 
       
   152     \end{itemize}
       
   153   \item Commands
       
   154     \begin{itemize}
       
   155     \item All commands begin with \textbackslash
       
   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 
       
   163 \begin{frame}[fragile]
       
   164   \frametitle{Top Matter}
       
   165   Let's add the Title, Author's name and the date to the document.
       
   166   \begin{itemize}
       
   167   \item Add title, author and date. Compile. Nothing changes.
       
   168   \end{itemize}
       
   169   \begin{lstlisting}
       
   170     \title{A Glimpse at Scipy}
       
   171     \author{FOSSEE}
       
   172     \date{June 2010}
       
   173   \end{lstlisting}
       
   174   \tiny{See \texttt{hg} rev1 of draft.}
       
   175 \end{frame}
       
   176 
       
   177 \begin{frame}[fragile]
       
   178   \frametitle{Top Matter \ldots}
       
   179   \begin{itemize}
       
   180   \item \lstinline{\maketitle} command inserts the top-matter.
       
   181   \item Compile again. 
       
   182   \item If no date is specified, today's date is automatically
       
   183     inserted.
       
   184   \end{itemize}
       
   185   \begin{lstlisting}
       
   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}
       
   193 
       
   194 
       
   195 \begin{frame}[fragile]
       
   196   \frametitle{Abstract}
       
   197   \begin{itemize}
       
   198   \item The abstract environment is placed at the location where it's
       
   199     put in the source. 
       
   200   \end{itemize}
       
   201   \begin{lstlisting}
       
   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}
       
   209 
       
   210 \begin{frame}[fragile]
       
   211   \frametitle{Sectioning}
       
   212   \begin{itemize}
       
   213   \item \lstinline{\section}, \lstinline{\subsection}
       
   214     \lstinline{\subsubsection}
       
   215   \item Auto numbered sections!
       
   216   \item \* to prevent numbering of a section
       
   217   \end{itemize}
       
   218   \begin{lstlisting}
       
   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}
       
   225 
       
   226 \begin{frame}[fragile]
       
   227   \frametitle{Sectioning \ldots}
       
   228   \begin{itemize}
       
   229   \item Longer documents, use \lstinline{report} or \lstinline{book}
       
   230     class
       
   231   \item Chapter can be added using \lstinline{\chapter}
       
   232   \end{itemize}
       
   233   \begin{lstlisting}
       
   234     \documentclass{report}
       
   235 
       
   236     \chapter{One}
       
   237   \end{lstlisting}
       
   238   \begin{itemize}
       
   239   \item subsections do not get numbering
       
   240   \item Change \lstinline{secnumdepth}
       
   241   \end{itemize}
       
   242   \begin{lstlisting}
       
   243     \setcounter{secnumdepth}{3}
       
   244   \end{lstlisting}
       
   245    \tiny See rev5 of \texttt{hg}
       
   246 \end{frame}
       
   247 
       
   248 \begin{frame}[fragile]
       
   249   \frametitle{Appendices}
       
   250   \begin{itemize}
       
   251   \item Anything following the \lstinline{\appendix} command is added
       
   252     to the Appendix. 
       
   253   \end{itemize}
       
   254   \begin{lstlisting}
       
   255     \appendix
       
   256     
       
   257     \section{Plotting using Pylab}
       
   258   \end{lstlisting}
       
   259   \tiny See rev7 of \texttt{hg}
       
   260 \end{frame}
       
   261 
       
   262 \begin{frame}[fragile]
       
   263   \frametitle{Table of Contents [TOC]}
       
   264   \begin{itemize}
       
   265   \item Our document is short, but let's learn to add a TOC.
       
   266   \item Add \lstinline{\tableofcontents} where you want TOC to
       
   267     appear.
       
   268   \item Compile. 
       
   269   \item Only headings appear. No page numbers. 
       
   270   \item A \lstinline{\.toc} file is generated. 
       
   271   \item Re-compile.
       
   272   \item Any numbered section/block automatically appears
       
   273   \end{itemize}
       
   274   \tiny See rev8 of \texttt{hg}
       
   275 \end{frame}
       
   276 
       
   277 \begin{frame}[fragile]
       
   278   \frametitle{TOC \ldots}
       
   279   \begin{itemize}
       
   280   \item To add un-numbered sections, use \lstinline{\addcontentsline}
       
   281   \end{itemize}
       
   282   \begin{lstlisting}
       
   283     \section*{Introduction}
       
   284     \addcontentsline{toc}{section}{Intro}
       
   285   \end{lstlisting}
       
   286   \tiny See rev9 of \texttt{hg}
       
   287 \end{frame}
       
   288 
       
   289 \begin{frame}
       
   290   \frametitle{Bibliography}
       
   291   We shall look at Bibliographies, later in the course. 
       
   292 \end{frame}
       
   293 
       
   294 \section{Typesetting Text}
       
   295 \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}
       
   310   \begin{itemize}
       
   311   \item The quotation marks around Sigh Pie are not formatted properly
       
   312   \item Use \`~ (accent) for left quote
       
   313   \item Use \'~ (apostrophe) for right quote
       
   314   \item For double quotes, use them twice
       
   315   \end{itemize}
       
   316   \begin{center}
       
   317     \`~\`~Sigh Pie\'~\'~
       
   318   \end{center}
       
   319   \tiny See rev11 of \texttt{hg}
       
   320 \end{frame}
       
   321 
       
   322 \begin{frame}[fragile]
       
   323   \frametitle{Fonts - Emphasis, Fixed width, \ldots}
       
   324   \begin{itemize}
       
   325   \item \lstinline{\emph} gives emphasized or italic text
       
   326   \item \LaTeX environments can be nested
       
   327   \item Let's add sub-package names as text, before learning to
       
   328     typeset tables
       
   329   \item Note multiple spacing won't work
       
   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}
       
   342 
       
   343 \begin{frame}[fragile]
       
   344   \frametitle{Fonts - Emphasis, Fixed width, \ldots}
       
   345   \begin{itemize}
       
   346   \item Use \lstinline{\texttt} for sub-packages names - fixed width
       
   347   \item \lstinline{\textbf} for bold face
       
   348   \item \lstinline{-} can be replaced with \lstinline{--} or
       
   349     \lstinline{---} for better formatting
       
   350   \end{itemize}
       
   351   \begin{lstlisting}
       
   352     \textbf{Subpackage} --- \textbf{Description}\\
       
   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]
       
   365   \frametitle{Lists}
       
   366   \begin{itemize}
       
   367   \item \lstinline{enumerate} environment is used for numbered lists
       
   368   \item \lstinline{itemize} environment gives un-numbered lists
       
   369   \item Each item in the list is specified using \lstinline{\item}
       
   370   \item Nested lists are also easily handled, as expected
       
   371   \item Example on next slide
       
   372   \end{itemize}
       
   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}
       
   397 
       
   398 \begin{frame}[fragile]
       
   399   \frametitle{Footnotes}
       
   400   \begin{itemize}
       
   401   \item Add footnote for \lstinline{pylab}
       
   402   \item It's easily done using \lstinline{\footnote} command 
       
   403   \end{itemize}
       
   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}
       
   415 
       
   416 \begin{frame}[fragile]
       
   417   \frametitle{Labels and References}
       
   418   \begin{itemize}
       
   419   \item First add a label to the section that we wish to refer to
       
   420   \item \lstinline+\label{labelname}+
       
   421   \item Change footnote to use the reference
       
   422   \item \lstinline+\ref{labelname}+
       
   423   \item Compile twice
       
   424   \end{itemize}
       
   425   \begin{lstlisting}
       
   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}
       
   432 
       
   433 \begin{frame}[fragile]
       
   434   \frametitle{Including code}
       
   435   \begin{itemize}
       
   436   \item Instead of using \lstinline{\texttt} we could use
       
   437     \lstinline{\verbatim} 
       
   438   \item \lstinline{listings} is a powerful package
       
   439   \item \lstinline+\usepackage{listings}+ needs to be added 
       
   440   \item Tell \LaTeX the language, you are going to use
       
   441   \end{itemize}
       
   442   \begin{lstlisting}
       
   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}
       
   450 
       
   451 \begin{frame}[fragile]
       
   452   \frametitle{Including code}
       
   453   \begin{itemize}
       
   454   \item Use \lstinline{lstlisting} for a block of code
       
   455   \item \lstinline+\lstinline+ for inline code
       
   456   \item Let's add the code to Appendix
       
   457   \end{itemize}
       
   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}
       
   468 
       
   469 \section{Figures, Tables \& Floats}
       
   470 \begin{frame}[fragile]
       
   471   \frametitle{Figures}
       
   472   \begin{itemize}
       
   473   \item Let's add the figure in the Appendix
       
   474   \item \lstinline+\usepackage{graphicx}+
       
   475   \item To add a graphic, use \lstinline{\includegraphics} command
       
   476   \item We give the relative path to the \lstinline+.png+ image
       
   477   \end{itemize}
       
   478   \begin{lstlisting}
       
   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}
       
   492 
       
   493 \begin{frame}[fragile]
       
   494   \frametitle{\lstinline{includgraphics}}
       
   495   It takes following optional arguments
       
   496   \begin{itemize}
       
   497   \item \lstinline+scale+ --- specifies the factor by which to scale
       
   498     the image 
       
   499   \item \lstinline+height+, \lstinline+width+ --- If only one of them
       
   500     is specified, aspect ratio is maintained 
       
   501   \item \lstinline+keepaspectratio+ --- boolean value to keep aspect
       
   502     ratio or not 
       
   503   \item \lstinline+angle+ --- specify by what angle the image should
       
   504     be rotated 
       
   505   \end{itemize}
       
   506 \end{frame}
       
   507 
       
   508 \begin{frame}[fragile]
       
   509   \frametitle{Floats}
       
   510   \begin{itemize}
       
   511   \item Graphics (\& Tables) are special because they cannot be broken
       
   512     across pages 
       
   513   \item They are ``floated'' to the next page, if they don't fit in
       
   514     the current page 
       
   515   \item Enclose graphic within \lstinline+figure+ environment to make
       
   516     it float 
       
   517   \item Figure environment takes additional parameter for location of
       
   518     float 
       
   519   \end{itemize}
       
   520   \begin{table}
       
   521     \caption{Permission Specifiers}
       
   522     
       
   523     \begin{tabular}{|c|c|}
       
   524       Specifier & Permission\\\hline
       
   525       t & Top of page\\
       
   526       b & Bottom of page\\
       
   527       p & Separate page for floats\\
       
   528       h & here (the same place where command appears in source)\\
       
   529       ! & override \LaTeX's internal parameters for good position
       
   530     \end{tabular}
       
   531   \end{table}
       
   532 \end{frame}
       
   533 
       
   534 \begin{frame}
       
   535   \frametitle{Captions and References}
       
   536   \begin{itemize}
       
   537   \item Figure environment allows us add a caption
       
   538   \item To place the image in the center we enclose it in the
       
   539     \lstinline+center+ environment 
       
   540   \item We can label images too
       
   541   \item label shoule be added after the caption command
       
   542   \item Figures are auto numbered
       
   543   \end{itemize}
       
   544   \tiny See rev17 of \texttt{hg}
       
   545 \end{frame}
       
   546 
       
   547 \subsection{Tables}
       
   548 
       
   549 \begin{frame}[frame]
       
   550   \frametitle{Tables}
       
   551   \begin{itemize}
       
   552   \item \lstinline+tabular+ is used to typeset a table
       
   553   \item It is enclosed in a \lstinline+table+ environment to make it a
       
   554     float 
       
   555   \item \lstinline+table+ environment also gives captions, auto
       
   556     numbering  
       
   557   \end{itemize}
       
   558 \end{frame}
       
   559 
       
   560 
       
   561 \begin{frame}[fragile]
       
   562   \frametitle{\lstinline+tabular+}
       
   563   \begin{itemize}
       
   564   \item tabular takes formatting of each column as argument
       
   565   \end{itemize}
       
   566 
       
   567   \begin{table}
       
   568     \caption{tabular environment}
       
   569     
       
   570     \begin{tabular}{|l|l|}
       
   571       \lstinline+l+ & left justified column content\\\hline
       
   572       \lstinline+r+ & right justified column content\\\hline
       
   573       \lstinline+c+ & centered column content\\\hline
       
   574       \lstinline+|+ & produces a vertical line\\
       
   575     \end{tabular}
       
   576   \end{table}
       
   577   \begin{itemize}
       
   578   \item also takes an optional parameter for specifying position of
       
   579     table 
       
   580   \item \lstinline+t+ for top, \lstinline+b+ for bottom, \lstinline+c+
       
   581     for center 
       
   582   \item each column of table is separated by \&
       
   583   \item each row is separated by newline \lstinline{\\}
       
   584   \item \lstinline+\hline+ give a horizontal line between two rows
       
   585   \end{itemize}
       
   586   \tiny See rev18 of \texttt{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}
       
   606 
       
   607 \begin{frame}[fragile]
       
   608   \frametitle{List of Tables, Figures}
       
   609   \begin{itemize}
       
   610   \item \lstinline+listoftables+
       
   611   \item \lstinline+listoffigures+
       
   612   \end{itemize}
       
   613 \end{frame}
       
   614 
       
   615 
       
   616 \section{Typesetting Math}
       
   617 \begin{frame}[fragile]
       
   618   \frametitle{Math in \LaTeX}
       
   619   \begin{itemize}
       
   620   \item Math is enclosed in a pair of \lstinline{$} signs o
       
   621     \lstinline+\(  \)+ %$
       
   622   \item Used for typesetting inline Math. 
       
   623   \item \lstinline+\usepackage{amsmath}+
       
   624   \item Let's now move on to matrices. 
       
   625   \end{itemize}
       
   626 \end{frame}
       
   627 
       
   628 \begin{frame}[fragile]
       
   629   \frametitle{Matrices}
       
   630   \begin{itemize}
       
   631   \item \lstinline+\bmatrix+ is used to typeset the matrix A
       
   632   \item It works similar to ta tabular environment
       
   633   \item \lstinline+&+ for demarcating columns
       
   634   \item \lstinline+\\+ for demwarcating rows
       
   635   \end{itemize}
       
   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}
       
   655     \center
       
   656     \begin{tabular}{c|c}
       
   657       \lstinline+matrix+  &  none\\
       
   658       \lstinline+pmatrix+ &  \lstinline+(+\\
       
   659       \lstinline+Bmatrix+ &  \lstinline+{+\\
       
   660         \lstinline+vmatrix+ &  \lstinline+|+\\  
       
   661         \lstinline+Vmatrix+ &  \lstinline+||+
       
   662     \end{tabular}
       
   663   \end{table}
       
   664 \end{frame}
       
   665 
       
   666 \begin{frame}[fragile]
       
   667   \frametitle{Superscripts \& Subscripts}
       
   668   \begin{itemize}
       
   669   \item \lstinline+^+ for superscripts
       
   670   \item To have multiple characters as sub/superscript, enclose in
       
   671     \lstinline+{ }+
       
   672   \item \lstinline+_+ for subscripts
       
   673   \end{itemize}
       
   674 \end{frame}
       
   675 
       
   676 \begin{frame}[fragile]
       
   677   \frametitle{Summation \& integration}
       
   678   \begin{itemize}
       
   679   \item \lstinline+\sum+ command gives the summation symbol
       
   680   \item The upper and lower limits are specified using the
       
   681     \lstinline+^+ and \lstinline+_+ symbols. 
       
   682   \item Similarly the integral symbol is obtained using
       
   683     \lstinline+\int+ command. 
       
   684   \end{itemize}
       
   685 \end{frame}
       
   686 
       
   687 \begin{frame}[fragile]
       
   688   \frametitle{\lstinline+displayed+ math}
       
   689   \begin{itemize}
       
   690   \item The equation in Determinants section is different. 
       
   691   \item It is a displayed equation. 
       
   692   \item \LaTeX~ or \lstinline+amsmath+ has a number of environments
       
   693     for ``displaying'' equations, with minor differences. 
       
   694   \item In general, enclose math in \lstinline+\[+ and \lstinline+\]+
       
   695     to get displayed math. 
       
   696   \item \lstinline+\begin*{equation}+ is equivalent to this.
       
   697   \item Use \lstinline+\begin{equation}+ to get numbered
       
   698     equations. %%\end{equation} 
       
   699   \end{itemize}
       
   700   \begin{lstlisting}
       
   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}
       
   705 
       
   706 \begin{frame}[fragile]
       
   707   \frametitle{Groups of equations}
       
   708   \begin{itemize}
       
   709   \item The \lstinline+equation+ environment allows typesetting of
       
   710     just 1 equation. 
       
   711   \item \lstinline+eqnarray+ allows typesetting of multiple equations 
       
   712   \item It is similar to the \lstinline+table+ environment
       
   713   \item The parts of the equation that need to be aligned are
       
   714     indicated using \& symbol.
       
   715   \item Each equation is separated by a \lstinline+\newline+ command
       
   716   \end{itemize}
       
   717   \begin{lstlisting}
       
   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}
       
   727 
       
   728 \begin{frame}[fragile]
       
   729   \frametitle{Fractions \& Surds}
       
   730   \begin{itemize}
       
   731   \item Fractions are typeset using \lstinline+\frac+ command 
       
   732   \item \lstinline+\frac{numerator}{denominator}+ is typeset as
       
   733     $\frac{numerator}{denominator}$
       
   734   \item Surds are typeset using \lstinline+\sqrt[n]+ command
       
   735   \end{itemize}
       
   736 \end{frame}
       
   737 
       
   738 \begin{frame}[fragile]
       
   739   \frametitle{Greek characters \& Spacing}
       
   740   \begin{itemize}
       
   741   \item Typesetting Greek characters is simple
       
   742   \item \lstinline+\alpha+, \lstinline+\beta+, \lstinline+\gamma+,
       
   743     \ldots \lstinline+\Alpha+, \lstinline+\Beta+, \lstinline+\Gamma+
       
   744     \ldots 
       
   745   \item To get additional spacing in Math environments ---
       
   746 \begin{center}
       
   747 \begin{tabular}{|l|l|l|}
       
   748 \hline
       
   749  Abbrev. & Spelled out & Example  \\
       
   750 \hline
       
   751  \lstinline+\,+ & \lstinline+\thinspace+ & $A\,B$ \\
       
   752 \hline
       
   753  \lstinline+\:+ & \lstinline+\medspace+ & $A\:B$ \\
       
   754 \hline
       
   755  \lstinline+\;+ & \lstinline+\thickspace+ & $A\;B$ \\
       
   756 \hline
       
   757    & \lstinline+\quad+ & $A \quad B$ \\
       
   758 \hline
       
   759    & \lstinline+\qquad+ & $A \qquad B$ \\
       
   760 \hline
       
   761  \lstinline+\!+ & \lstinline+\negthinspace+ & $A!B$ \\
       
   762 \hline
       
   763    & \lstinline+\negmedspace+ & $A \negmedspace B$ \\
       
   764 \hline
       
   765    & \lstinline+\negthickspace+ & $A \negthickspace B$ \\
       
   766 \hline
       
   767 
       
   768 \end{tabular}
       
   769 \end{center}
       
   770   \end{itemize}
       
   771 \end{frame}
       
   772 
       
   773 \section{Bibliography}
       
   774 \begin{frame}[fragile]
       
   775   \frametitle{Bibliography}
       
   776   \begin{itemize}
       
   777   \item \lstinline+thebibliography+ environment provides a clean and
       
   778     simple way to add a bibliography to \LaTeX documents. 
       
   779   \item \lstinline+\begin{thebibliography}+ takes as argument the
       
   780     maximum with of the label that references will have. 
       
   781   \item Each item of the Bibliography is similar to an item in a
       
   782     list. 
       
   783   \item \lstinline+\bibitem[label]{name}+ followed by the actual
       
   784     reference info. 
       
   785   \item label replaces auto enumeration numbers 
       
   786   \item \lstinline+\cite{name}+ is used to \lstinline+cite+ the
       
   787     \lstinline+bibitem+ 
       
   788   \item You will need to compile twice. 
       
   789   \end{itemize}
       
   790 \end{frame}
       
   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}
       
   803 
       
   804 \section{Presentations - Beamer}
       
   805 \begin{frame}[fragile]
       
   806   \frametitle{Beamer}
       
   807   \begin{itemize}
       
   808   \item Use beamer since your report's \LaTeX~ would be re-usable.
       
   809   \item It is recommended to start with on of the beamer templates.
       
   810   \item Let's look at speaker introduction template.
       
   811   \item \lstinline+\documentclass{beamer}+ tells \LaTeX~ to start a
       
   812     beamer presentation. 
       
   813   \item A beamer document is very similar to any other \LaTeX~
       
   814     document except that content is divided into slides. 
       
   815   \end{itemize}
       
   816 \end{frame}
       
   817 
       
   818 \begin{frame}[fragile]
       
   819   \frametitle{Beamer \ldots}
       
   820   \begin{itemize}
       
   821   \item \lstinline+\usetheme+ command is used to specify the theme of the
       
   822     presentation. 
       
   823   \item \lstinline+\usecolortheme+ command is used to specify the color
       
   824     theme. 
       
   825   \item The content of a slide is enclosed within
       
   826     \lstinline+\begin{frame}{Title}{Subtitle}+ and
       
   827     \lstinline+\end{frame}+ 
       
   828   \item If the slide contains \lstinline+verbatim+
       
   829     \lstinline+lstlisting+ environments, the \lstinline+\begin{frame}+
       
   830     should be passed an additional argument \lstinline+[fragile]+
       
   831   \item Overlays can be achieved using the \lstinline+\pause+
       
   832     command. 
       
   833   \item To achieve more with beamer, it is highly recommended that you
       
   834     look at the \texttt{beameruserguide} 
       
   835   \end{itemize}
       
   836 \end{frame}
       
   837 
       
   838 \end{document} 
       
   839