latex/handout.rst
author Puneeth Chaganti <punchagan@fossee.in>
Tue, 31 Aug 2010 18:49:43 +0530
changeset 104 828c65311bdf
parent 103 313bebeb7862
child 157 3174d4803cd5
permissions -rw-r--r--
Updated handout.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     1
LaTeX
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     2
=====
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     3
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     4
Introduction
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     5
------------
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     6
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
     7
LaTeX is a typesetting program that produces excellently typeset
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
     8
documents. Typesetting is placing text onto a page with all the style
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
     9
formatting defined, so that content looks as intended. It is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    10
extensively used for producing high quality scientific and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    11
mathematical documents. It is also used for producing other kinds of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    12
documents, ranging from simple one page articles or letters to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    13
books. LaTeX is based on the TeX typesetting language.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    14
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    15
LaTeX is pronounced either as "Lah-tech" or "Lay-tech"
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    16
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    17
In this course, we shall use the sample document, ``sample.pdf``, as a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    18
tool to learn various commands of LaTeX. By the end of the sessions on
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    19
LaTeX, we will have produced a copy of that document, starting from
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    20
scratch.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    21
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    22
A Look at the Sample Document
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    23
-----------------------------
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    24
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    25
Let's first look at the basic structure of the sample document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    26
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    27
Slides with screen shots of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    28
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    29
  * Title, Author, Date
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    30
  * Abstract
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    31
  * Sections
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    32
  * Subsections
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    33
  * Appendix
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    34
  * References/Bibliography
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    35
  * Tables
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    36
  * Figures
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    37
  * Math
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    38
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    39
Writing the source & compiling it
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    40
---------------------------------
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    41
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    42
Let's begin with a simple hello world, to see how to write a LaTeX
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    43
document and compile it.  Write the following code into the file
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    44
``draft.tex``.  ::
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    45
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    46
  \documentclass{article}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    47
  \begin{document}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    48
  SciPy is open-source software for mathematics, science, and engineering.   
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    49
  \end{document}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    50
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    51
To compile the document, do the following in your terminal::
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    52
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    53
  $ pdfLaTeX draft.tex
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    54
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    55
This produces the output file ``draft.pdf``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    56
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    57
Note: The ``LaTeX`` command is often used, instead of ``pdfLaTeX`` to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    58
get the ``dvi`` output. But, throughout this course, we shall use
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    59
pdfLaTeX to compile our documents.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    60
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    61
``\documentclass``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    62
------------------
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    63
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    64
The documentclass command, defines the structure and formatting of our
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    65
document. LaTeX typsets the document, based on the documentclass.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    66
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    67
LaTeX is a document based markup language. 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    68
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    69
First of all, a markup language is a system of annotating text or
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    70
adding in extra information to the text that specifies it's structure
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    71
or presentation.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    72
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    73
LaTeX is a document based markup and not an element based one. You
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    74
generally don't have to worry about typesetting each of the elements
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    75
of your document. Choosing an appropriate documentclass, gives you a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    76
suitable typesetting. You as an author can worry about the content of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    77
the document, rather than the appearance or presentation of the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    78
document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    79
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
    80
Why should you use it?
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
    81
~~~~~~~~~~~~~~~~~~~~~~
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    82
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
    83
A few reasons for using LaTeX - 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    84
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    85
  * It produces documents with excellent visual quality.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    86
  * It does the typesetting for you, leaving you - the author - to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    87
    focus on writing the content.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
    88
  * It makes writing math just as easy as writing simple text.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    89
  * It's renowned for it's stability and a virtually bug free code
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    90
    base.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    91
  * It is light on your resources as compared to most of the word
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    92
    processors available today.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    93
  * It uses plain text files as input and can give output in a variety
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    94
    of formats including PDFs and html making it platform independent.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    95
  * It is free software (free as in freedom) and gratis too.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
    96
  * It is widely used and has a large user community. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    97
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    98
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    99
``\begin`` and ``\end`` commands define environments. In our document,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   100
we have the document environment, which defines the beginning and end
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   101
of the content of the document. We place all the content of the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   102
document within this environment.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   103
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   104
Also, as you may have noticed, all the commands in LaTeX begin with a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   105
``\``. Note that they are case sensitive. Command names in LaTeX
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   106
usually have only alpha characters. Any characters other than alpha
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   107
characters, terminate the command name. Parameters to commands are
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   108
passed in ``{ }``.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   109
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   110
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   111
Top Matter
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   112
----------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   113
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   114
Let us begin with adding the Title, Author's name and the date to the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   115
document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   116
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   117
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   118
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   119
  \documentclass{article}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   120
  \title{A Glimpse at Scipy}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   121
  \author{FOSSEE}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   122
  \date{June 2010}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   123
  \begin{document}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   124
  \maketitle
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   125
  SciPy is open-source software for mathematics, science, and engineering.   
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   126
  \end{document}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   127
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   128
We add the title, the author and the date to the document before the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   129
``\begin{document}`` directive. We compile the document to see if the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   130
details appear in the document, but they donot. These details do not
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   131
appear in the document until we use the ``\maketitle`` command with
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   132
the document environment to instruct LaTeX to place the top matter
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   133
information into the document. Now the document has these details, on
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   134
compiling again.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   135
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   136
If no date is specified, LaTeX automatically inserts the current date.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   137
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   138
Abstract
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   139
--------
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   140
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   141
Next we shall add an abstract to our document. LaTeX provides an
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   142
environment, for adding an abstract to the document.  ::
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   143
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   144
  \documentclass{article}
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   145
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   146
  \title{A Glimpse at Scipy}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   147
  \author{FOSSEE}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   148
  \date{June 2010}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   149
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   150
  \begin{document}
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   151
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   152
  \maketitle
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   153
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   154
  \begin{abstract}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   155
  This document shows a glimpse of the features of Scipy that will be explored during this course.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   156
  \end{abstract}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   157
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   158
  SciPy is open-source software for mathematics, science, and engineering.   
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   159
  \end{document}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   160
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   161
The abstract environment is placed at the location where we wish it to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   162
appear in the document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   163
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   164
Sections
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   165
--------
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   166
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   167
Now let's look at how to add (chapters,) sections and sub-sections to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   168
our document. Let's add the section headings and sub headings present
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   169
in our sample document to the working copy of our document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   170
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   171
``\section``, ``\subsection``, ``\subsubsection``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   172
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   173
On compiling, we can see that the headings of the sections and the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   174
sub-sections appear in the document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   175
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   176
You may have noticed that LaTeX automatically numbers the sections. To
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   177
prevent a section from getting numbered, an asterix is appended to the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   178
corresponding sectioning command.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   179
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   180
If the document was a longer document, we could have used a report or
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   181
a book class. (Note: Books donot have the abstract environment.) Let's
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   182
look at what happens to the document, when we change it to the report
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   183
class.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   184
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   185
The numbering strangely begins from zero, now. This is because,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   186
chapters have an additional sectioning command called
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   187
``\chapter``. The chapter is one level above a section and since, our
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   188
document does not have a ``\chapter`` command, the sections are
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   189
numbered from 0. To change this, we add a chapter command before the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   190
first section. We say::
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   191
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   192
  \chapter{One}
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   193
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   194
Now, observe that we now have a chapter title appearing and the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   195
numbering starting from 1.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   196
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   197
Also, note that the subsubsections donot get a numbering now. This is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   198
controlled by a variable called the secnumdepth. By default it is set
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   199
to 2. We can now, change it to 3 and get numbering for subsubsections
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   200
also.  ::
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   201
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   202
  \setcounter{secnumdepth}{3}
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   203
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   204
What do you expect to happen if we changed the secnumdepth to 1? What
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   205
if it is 0? -1? {Lab excercise}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   206
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   207
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   208
Appendix
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   209
--------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   210
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   211
Notice that our document also has an appendix. Let's add an appendix
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   212
to our document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   213
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   214
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   215
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   216
  \appendix
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   217
  \section{Plotting using Pylab}
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   218
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   219
Table of Contents
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   220
-----------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   221
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   222
Our sample document is not long enough to warrant a table of contents,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   223
but let us learn to add a table of contents to a LaTeX document. If
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   224
you ever tried adding a table of contents, to a document in a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   225
wordprocessor, you would know how much of a trouble it is. In LaTeX,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   226
it is a matter of just one command and placing the command at the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   227
location where you would want to have the table of contents. Let's now
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   228
add a table of contents to our draft. Now, compile the document and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   229
look at the output document. It does not have the table of contents!
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   230
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   231
On the first compilation only the "Contents" heading appears in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   232
document, but the actual table does not appear. You will need to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   233
compile your document once more, for the actual table to appear in
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   234
your document. On the first run, LaTeX has gone through your document
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   235
and generated a temporary file (``.toc``), with the entries that
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   236
should go into the table of contents. These entries are made, when you
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   237
compile your document for the second time.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   238
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   239
Note that any section/block that has been numbered automatically
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   240
appears in the table of contents. It is possible to get un-numbered
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   241
sections, for instance a Preface or a Foreword section to appear in
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   242
the Table of Contents.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   243
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   244
Let's change our Introduction section to be an un-numbered one and try
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   245
to make it appear in the table-of-contents.  ::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   246
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   247
  \section*{Introduction}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   248
  \addcontentsline{toc}{section}{Intro}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   249
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   250
We shall talk about adding and managing bibliographies, later in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   251
course.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   252
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   253
Now, that we have the basic structure of the document, let's get into
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   254
the content and the details of it.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   255
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   256
Typesetting Text
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   257
----------------
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   258
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   259
Let's begin with adding the second paragraph to the introduction
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   260
section. Let's place the text of the second para, after the first
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   261
line, that we already have. Now, compile the document. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   262
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   263
Notice, that the second para appears in continuation with the previous
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   264
line. To start a new paragraph in LaTeX, we need to insert an empty
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   265
line. Multiple empty lines are considered as a single empty line. To
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   266
start a new line, use the ``\newline`` or ``\\`` command. Notice the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   267
difference (in the output), in starting a new paragraph and starting a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   268
newline. A new paragraph is indented.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   269
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   270
Quotation Marks
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   271
---------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   272
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   273
Look at the quotation marks around the text, Sigh Pie. They are not
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   274
formatted properly. To place quotation marks in LaTeX, you should use
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   275
````` character for the left quote & ``'`` character for the right
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   276
quote. For double quotes, they should be used twice.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   277
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   278
Fonts
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   279
-----
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   280
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   281
The names of the software tools, Scilab, Matlab, etc. appear in
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   282
italics or emphasized as it is called in LaTeX. To emphasize text, the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   283
``\emph`` command is used.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   284
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   285
Let's also add the contents of the subsection "Sub-packages of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   286
Scipy". We shall add the table as plain text, until we learn how to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   287
edit tables.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   288
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   289
Let's try and form a tabular structure by separating the left and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   290
right columns using spaces. On compiling we find that LaTeX doesn't
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   291
add multiple spaces between words. Just like multiple empty lines,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   292
multiple spaces are considered as a single space.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   293
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   294
The names of the sub-packages appear in a fixed width font in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   295
sample document provided to us. The headings of the columns appear in
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   296
bold-face. Let's make changes to this effect.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   297
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   298
``\textbf`` is used to change text to bold face and ``\texttt`` is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   299
used to change text to fixed width font.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   300
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   301
We could also change the separating - (hyphen) to an em-dash (or
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   302
en-dash) -- is em-dash and --- is an em-dash, to improve the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   303
appearance of the document.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   304
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   305
Lists
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   306
-----
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   307
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   308
The section on Use of Scipy in this course, contains lists. Let's now
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   309
add lists to our document. The ``enumerate`` environment adds numbered
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   310
lists to our document and the ``itemize`` environment adds un-numbered
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   311
lists. ``\item`` command adds a new entry to a list. Note, that LaTeX
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   312
can easily handle nested lists. In fact most environments can be
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   313
embedded within other environments, without any problems.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   314
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   315
LaTeX also has a description list, which shall be looked at, during
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   316
the lab sessions.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   317
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   318
Footnotes, Labels and References
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   319
--------------------------------
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   320
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   321
Let's now add the footnote to pylab. LaTeX provides a footnote command
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   322
to add a footnote.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   323
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   324
We added the footnote with Appendix A, as plain text. But, in case we
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   325
added another Appendix before the section on using ``pylab``, the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   326
footnote will have to be edited. To avoid this, LaTeX provides a handy
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   327
system of labels and referencing.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   328
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   329
We first add a label to the section that we want to refer in this
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   330
footnote. Then, we change the footnote, and add the reference to this
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   331
label instead of the character A. If you look at the output after
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   332
compiling the document once, you will see that the footnote has
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   333
question marks instead of the section number.  You will have to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   334
compile once again, for the section number to appear in the footnote.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   335
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   336
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   337
Including code
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   338
--------------
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   339
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   340
In the footnote above, and in the table for the sub-packages list, we
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   341
used the ``\texttt`` command to get a fixed width font. But we could
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   342
instead use an environment provided by LaTeX to include pre-formatted
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   343
text or code. LaTeX by default provides the verbatim environment to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   344
include pre-formatted text. You can try that out during the lab
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   345
session. We shall look at using the listings package, specifically
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   346
meant for including code in our document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   347
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   348
First of all you need to tell LaTeX, that you want to use the listings
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   349
package in your document. We add the directive
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   350
``\usepackage{listings}`` to the preamble of our document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   351
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   352
Then we set the language of the code that we are going to embed into
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   353
our document. For this we use the lstset command.  ::
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   354
 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   355
  \lstset{language=Python,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   356
          showstringspaces=false,}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   357
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   358
The listings package allows you to use color and do a lot of things
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   359
with your embedded code, but all that during a lab exercise.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   360
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   361
Now, to put a line of code, inline and not as a separate block, we use
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   362
the ``\lstinline`` command. We change the name pylab in the footnote
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   363
to use lstinline instead of the texttt. To embed a block of code, we
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   364
use the lstlisting environment (``\begin{lstlisting}`` and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   365
``\end{lstlisting}``). For example, let's add the code to the Appendix
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   366
of our document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   367
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   368
Figures, Tables and Floats
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   369
--------------------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   370
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   371
Let's now add the figure, to the appendix.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   372
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   373
To include graphics in a LaTeX document, we need to use the graphicx
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   374
package. Add the ``\usepackage{graphicx}`` directive to the preamble
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   375
of the document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   376
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   377
To add the graphic, use the ``includegraphics`` command. The relative
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   378
path of the image that we wish to include is passed as an argument to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   379
includegraphics. It takes an optional argument of scaling the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   380
image. We use a scale of 0.4 to scale our image.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   381
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   382
It takes other optional arguments. 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   383
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   384
  ``width=x``, ``height=x`` 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   385
    If only the height or width is specified,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   386
    the image is scaled, maintaining the aspect ratio.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   387
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   388
  ``keepaspectratio``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   389
    This parameter can either be set to true or false. When set to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   390
    true, the image is scaled according to both width and height,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   391
    without changing the aspect ratio, so that it does not exceed both
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   392
    the width and the height dimensions.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   393
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   394
  ``angle=x``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   395
    This option can be used to rotate the image by ``x`` degrees,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   396
    counter-clockwise.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   397
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   398
Figures (and tables) are treated specially because, they cannot be
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   399
broken across pages. They are "floated" across to the next page, if
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   400
they donot fit on the current page, filling the current page with
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   401
text.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   402
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   403
To make our graphic into a float, we should enlose it within a figure
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   404
environment. For a table, the table environment should be used. We now
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   405
move our graphic into a figure environment. The figure environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   406
takes an additional parameter for the location of the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   407
float. ``\begin{figure}[hbtp!]``. The specifiers ``htbp`` are
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   408
permissions to place the float at various locations. ``t`` for top of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   409
page, ``b`` for bottom of page, ``p`` for a separate page for floats
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   410
and ``h`` for here, as in the same place where the command appears in
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   411
the source. ``!`` mark overrides a few of LaTeX's internal parameters
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   412
for good position of floats.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   413
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   414
The figure environment also, allows us to add a caption to the graphic
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   415
using the ``\caption`` command.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   416
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   417
To place the graphic in the center aligned in the page, we use the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   418
center environment.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   419
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   420
To label a figure, we just add a label with in the figure
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   421
environment. Note, that the label to a figure should be added after
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   422
the caption command. Also, note that tables are auto-numbered.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   423
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   424
Let us finish the appendix, by adding the content present at the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   425
beginning of the appendix. The bibliographic citations will be dealt
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   426
with later.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   427
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   428
Tables
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   429
~~~~~~
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   430
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   431
Now, let us look at the other kind of floats - Tables. We shall
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   432
convert the list of sub-packages in the sub-packages section to a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   433
table.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   434
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   435
To begin a table, we use the tabular environment. And to make this a
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   436
float, it is enclosed in the table environment. The table environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   437
also allows us to add captions to the table and Tables are also auto
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   438
numbered.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   439
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   440
The tabular environment takes as arguments the columns and the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   441
formatting of each column. The possible arguments to the tabular
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   442
environment are
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   443
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   444
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   445
| ``l``         | left justified column content      |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   446
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   447
| ``r``         | right justified column content     |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   448
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   449
| ``c``         | centered column content            |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   450
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   451
| ``|``         | produces a vertical line.          |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   452
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   453
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   454
It also takes an optional parameter that specifies the position of the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   455
table; ``t`` for top, ``b`` for bottom, or ``c`` for center.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   456
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   457
Each column of a table is separated by an ``&`` symbol and each row is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   458
separated by a new line. The ``\hline`` command allows you to draw
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   459
horizontal lines between two rows of the table. But it does not allow
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   460
you do draw partial lines. ``\cline{a-b}`` draws a horizontal line
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   461
from column ``a`` to column ``b``.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   462
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   463
We also add a label to the table and refer to it in the first line of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   464
the section.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   465
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   466
You could also add a listoftables or listoffigures to the document,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   467
similar to the way we added table of contents.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   468
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   469
Typesetting Math
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   470
----------------
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   471
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   472
Now we shall move to typesetting the Math in the sample document given
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   473
to us. We shall start with the Matrices subsection.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   474
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   475
In general, it is advised to use the AMS-LaTeX bundle to typeset
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   476
mathematics in LaTeX. AMS-LaTeX is a collection of packages and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   477
classes for mathematical typesetting.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   478
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   479
We load ``amsmath`` by issuing the ``\usepackage{amsmath}`` in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   480
preamble. Through out this section, it is assumed that the ``amsmath``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   481
package has been loaded.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   482
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   483
Let's now typeset the matrix A.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   484
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   485
To typeset math, we just have to enclose it within ``\(`` and ``\)``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   486
or a pair of ``$`` signs.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   487
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   488
To typeset the matrix A, we use the ``bmatrix`` environment. It works
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   489
similar to a tabular environment - ``&`` is used to demarcate columns
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   490
and ``\\`` is used to add a new row. ``bmatrix`` environment gives the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   491
``[`` ``]`` as delimiters. There are 5 other matrix environments
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   492
giving matrices with other delimiters - ``matrix`` (none), ``pmatrix``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   493
``(``, ``Bmatrix`` ``{``, ``vmatrix`` ``|`` and ``Vmatrix`` ``||``.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   494
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   495
To write the name of the matrix A, a bold-faced A is used. This is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   496
obtained by using the ``\mathbf`` command.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   497
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   498
This subsection doesn't have much more math. The next section on
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   499
inverse doesn't have anything new except for writing inverse of A.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   500
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   501
To typeset superscripts in LaTeX, the ``^`` character is used. The
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   502
carat operator just acts on the next character. To have multiple
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   503
characters as superscript they must be enclosed in ``{ }``. Similarly
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   504
for typesetting text as subscripts the ``_`` character is used.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   505
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   506
To typeset the summation symbol, use the command ``\sum.`` The upper
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   507
and lower limits are specified using the ``^`` and ``_``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   508
characters. Similarly, the integral symbol is obtained using the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   509
``\int`` command.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   510
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   511
Next, let us type in the equation present in the section on
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   512
Determinants. Note that it is different from all the math we've typed
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   513
until now, since it is not inline and is "displayed", in the LaTeX
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   514
lingo. LaTeX has a number of environments for displaying equations,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   515
with minor subtle differences. In general use ``\[`` ``\]`` to typeset
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   516
displayed equations without numbering them. ``\begin{equation*}`` is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   517
equivalent to it.  To obtain numbered equations use
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   518
``\begin{equation}``.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   519
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   520
Next we wish to typeset a group of equations. The equation environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   521
does not accept ``\\`` to get a new line. For multiple equations
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   522
amsmath has a handful of environments with subtle differences. We
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   523
shall use the ``eqnarray`` environment. ``eqnarray*`` environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   524
gives unnumbered equations, as expected. The ``eqnarray`` environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   525
works similar to a table environment. The parts of the equation that
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   526
need to be aligned are indicated using an ``&`` symbol. The
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   527
``newline`` command is used to enter a every new equation after the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   528
first one. We now typeset the equations in the section on linear
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   529
equations using the ``eqnarray`` environment. (The equations in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   530
determinants section use ``eqnarray*``)
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   531
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   532
We next typeset the math in the section on polynomials. To typeset
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   533
fractions use the ``\frac`` command. To typeset surds, we use the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   534
``\sqrt`` command with the optional paramter of ``[n]``.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   535
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   536
Inserting Greek letters into LaTeX is simple. ``\alpha``, ``\beta``,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   537
``\gamma``, ... on for small letters and ``\Alpha``, ``\Beta``,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   538
``\Gamma``, ... for capital.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   539
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   540
Also, math environments do not give extra spaces using the space or
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   541
tab characters. The following commands are available to specify the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   542
spacing required.
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   543
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   544
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   545
| Abbrev. | Spelled out        | Example |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   546
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   547
| ``\,``  | ``\thinspace``     |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   548
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   549
| ``\:``  | ``\medspace``      |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   550
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   551
| ``\;``  | ``\thickspace``    |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   552
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   553
|         | ``\quad``          |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   554
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   555
|         | ``\qquad``         |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   556
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   557
| ``\!``  | ``\negthinspace``  |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   558
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   559
|         | ``\negmedspace``   |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   560
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   561
|         | ``\negthickspace`` |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   562
+---------+--------------------+---------+
101
e529bec52b6f Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents: 63
diff changeset
   563
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   564
Bibliography
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   565
------------
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   566
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   567
Let's now look at how to write bibliography and cite references.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   568
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   569
Writing bibliographies in LaTeX using the ``thebibliography``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   570
environment is pretty easy. You simply have to list down all the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   571
bibliography items within the bibliography environment.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   572
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   573
Each entry of the bibliography begins with the command
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   574
``\bibitem[label]{name}``. The name is used to cite the bibliography
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   575
item within the document using ``\cite{name}``. The label option
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   576
replaces the numbers from the auto enumeration with the labels given.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   577
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   578
The ``9`` passed as an argument to ``thebibliography`` command
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   579
indicates the maximum width of the label that the references will
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   580
have. In our sample document, we have less than 10 items in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   581
Bibliography and therefore we use 9.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   582
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   583
Presentations with Beamer
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   584
-------------------------
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   585
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   586
Using beamer for you presentations is a good idea, since you can use
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   587
the LaTeX that you have used for the report/document for the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   588
presentation as well.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   589
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   590
To write a ``beamer`` presentation, it is recommended that we use one
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   591
of the templates that beamer provides. We shall use the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   592
``speaker_introduction`` template to get started with beamer.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   593
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   594
As you can see, the document begins with the ``documentclass`` being
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   595
set to beamer.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   596
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   597
``\usetheme`` command sets the theme to be used in the presentation.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   598
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   599
``\usecolortheme`` command sets the color theme of the presentation.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   600
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   601
Notice that each slide is enclosed within ``\begin{frame}`` and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   602
``\end{frame}`` commands. The ``\begin{frame}`` command can be passed
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   603
the Title and Subtitle of the slide as parameters.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   604
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   605
The title page of the presentation can be set like any other LaTeX
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   606
document.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   607
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   608
To do overlays, use the ``\pause`` command. It does sequential
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   609
overlays. Non sequential overlays can also be done. (Lab exercise.)
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   610
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   611
If you have fragile environments like ``verbatim`` or ``lstlisting``,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   612
you need to give the frame an optional parameter ``[fragile]``.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   613
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   614
To achieve more with beamer, it is highly recommended that you look at
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   615
the ``beameruserguide``.
56
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   616