latex/handout.rst
author Puneeth Chaganti <punchagan@fossee.in>
Sun, 06 Feb 2011 17:57:03 +0530
changeset 157 3174d4803cd5
parent 104 828c65311bdf
permissions -rw-r--r--
latex: Changes to slides and handout before and after class.
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
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
     7
LaTeX is a typesetting program that produces excellently typeset documents.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
     8
Typesetting is placing text onto a page with all the style formatting
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
     9
defined, so that content looks as intended. It is extensively used for
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    10
producing high quality scientific and mathematical documents. It may also be
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    11
used for producing other kinds of documents, ranging from simple one page
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    12
articles to complete books. LaTeX is based on the TeX typesetting language.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    13
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    14
LaTeX is pronounced either as "Lah-tech" or "Lay-tech". 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    15
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    16
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    17
Why LaTeX?
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    18
~~~~~~~~~~
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    19
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    20
A few reasons for using LaTeX - 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    21
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    22
  * It produces documents with excellent visual quality.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    23
  * It does the typesetting for you, leaving you - the author - to focus on
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    24
    writing the content. You will appreciate this, as you learn more.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    25
  * It makes writing math just as easy as writing simple text.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    26
  * It's renowned for it's stability and a virtually bug free code base.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    27
  * It is light on your resources as compared to most of the word processors
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    28
    available today.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    29
  * It uses plain text files as input and can give output in a variety of
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    30
    formats including PDFs and html making it platform independent.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    31
  * It is free software (free as in freedom) and gratis too.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    32
  * 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
    33
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    34
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    35
Course Outline
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    36
~~~~~~~~~~~~~~
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    37
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    38
In this course, we will learn enough LaTeX to be a able to produce a simple
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    39
document with text, tables, figures, math, references and bibliography. We
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    40
will also briefly see how to create presentations using LaTeX, such as the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    41
one use for the slides of this course.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    42
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    43
The sample document, ``sample.pdf``, available in the course material, will
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    44
serve as a teaching/learning tool to learn LaTeX. During the course, we shall
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    45
reproduce this sample document, starting from scratch, in LaTeX
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    46
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    47
A Look at the Sample Document
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    48
+++++++++++++++++++++++++++++
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    49
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    50
A look at the sample document gives us an idea about the various elements
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    51
present in the document, that we will be learning during this course.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    52
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    53
We shall be learning how to add the following elements to our LaTeX
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    54
documents.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    55
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    56
  * Title, Author, Date
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    57
  * Abstract
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    58
  * Sections & Subsections
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    59
  * Appendices
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    60
  * References/Bibliography
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    61
  * Tables
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    62
  * Figures
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    63
  * Math
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    64
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    65
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    66
LaTeX is not a Word Processor
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    67
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    68
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    69
What do we mean by LaTeX not being a Word Processor? Suppose we wanted to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    70
create a simple document as shown in the image below. If one used a normal
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    71
word processor, the author would have to worry about setting the font sizes
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    72
of the fonts, centering the title, date and author information, etc.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    73
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    74
.. image:: images/latex_not_wp.png
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    75
   :alt: LaTeX is not a Word Processor
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    76
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    77
To generate this document in LaTeX, we just tell it what we want as the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    78
title, author's name, date etc. and what we want as the content. LaTeX takes
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    79
care of proper font size ratios and other presentation details.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    80
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    81
::
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
    82
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    83
  \documentclass{article}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    84
  \title{My First Document}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    85
  \author{FOSSEE}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    86
  \date{January 2011}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    87
  \begin{document}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    88
     \maketitle
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    89
     Hello world!
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    90
  \end{document}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    91
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    92
LaTeX can be considered to be a document based markup language. What we mean
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    93
by a markup language is that you mark up pieces of your text to be particular
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    94
elements of your document and then a typesetter or processor typesets your
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    95
document based on a set of rules. What do we mean by being document-based? It
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    96
means, that in LaTeX, you can change the structure of the whole document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    97
consistently, with a few changes in the preamble of the document, with-out
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    98
having to change each element separately.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
    99
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   100
First steps -- Typesetting a minimal document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   101
---------------------------------------------
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   102
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   103
Let us start with a minimal example to learn how to write a LaTeX document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   104
and compile it to see the **typeset** output.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   105
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   106
To begin, type out the following code into your text editor and save it as
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   107
``draft.tex``. ::
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   108
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   109
  \documentclass{article}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   110
  \begin{document}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   111
  SciPy is open-source software for mathematics, science, and engineering.   
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   112
  \end{document}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   113
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   114
To compile your document, type the following command in your terminal::
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   115
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   116
  $ pdflatex draft.tex
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   117
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   118
This produces the output file ``draft.pdf``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   119
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   120
Note: The ``latex`` command is often used, instead of ``pdflatex`` to get the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   121
``dvi`` output. But, throughout this course, we shall use ``pdflatex`` to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   122
compile our documents.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   123
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   124
What does it mean?
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   125
~~~~~~~~~~~~~~~~~~
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   126
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   127
As we have already seen, LaTeX is a document based markup. The first line,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   128
``\documentclass{article}``, tells that our document is an article type
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   129
document. LaTeX then, typesets the document accordingly. The documentclass
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   130
command, defines the structure and formatting of our document.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   131
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   132
The ``begin`` and ``end`` document commands, mark the beginning and the end
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   133
of the content of the LaTeX document. The text in between the begin and end
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   134
commands is typeset in the output document. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   135
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   136
A little digression
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   137
~~~~~~~~~~~~~~~~~~~
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   138
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   139
Just like in ``bash`` and ``Python``, the commands in LaTeX are
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   140
case-sensitive. ``\Documentclass`` is therefore not a valid command. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   141
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   142
All the commands in LaTeX begin with a ``\``. An environment begins with a
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   143
``begin`` command and ends with an ``end`` command. In our minimal example,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   144
``document`` is an environment. Only the text enclosed by the begin and end
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   145
commands is effected by the environment. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   146
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   147
So, as expected LaTeX ignores anything that is written after the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   148
``\end{document}`` command. (The part of the file before the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   149
``\begin{document}`` command is called the preamble, and is used to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   150
*"configure"* the LaTeX typesetter and change various parameters for
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   151
typesetting. Details later.)
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   152
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   153
Essentially, anything written after the ``\end{document}`` command turns out
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   154
to be a comment. But, how do we write comments with in the document. ``%`` is
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   155
the character to indicate comments. Anything written after a ``%`` symbol in
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   156
a line, is ignored. For example, we can add a comment to the minimal document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   157
saying, this is our first document in LaTeX, by saying ``% My First LaTeX
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   158
document``. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   159
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   160
But what if we wanted to insert the ``%`` symbol in the document? We can do
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   161
so by escaping it with a ``\`` (backslash). ``%`` is one of the many special
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   162
characters in LaTeX. The others are, ``~ # $ ^ & _ { } \``. All of them,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   163
except the ``\`` itself, can be inserted by escaping it with a ``\``. To
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   164
insert a ``\`` in our document, we use the command ``\textbackslash``. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   165
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   166
What would happen if we escape a ``\`` with a ``\``? Yes, you guessed it. A
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   167
double backslash is actually another command. It inserts a new line in the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   168
typeset document. The ``\\`` command or ``\newline`` command is used to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   169
insert a newline in the output document. Line breaks in the input document,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   170
do not translate into line breaks in the output document. A single line break
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   171
in the input document, doesn't cause any change in the output. A single empty
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   172
line causes a change in paragraphs in the output. (Multiple empty lines are
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   173
equivalent to a single empty line.) Similarly, multiple spaces are treated as
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   174
a single space. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   175
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   176
Adding Structure
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   177
----------------
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   178
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   179
Let us now, look at giving the document some basic structure, like title,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   180
sections, etc. 
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   181
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   182
``\documentclass``
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   183
~~~~~~~~~~~~~~~~~~
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   184
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   185
As we have already seen, the ``documentclass`` command tells LaTeX, the type
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   186
of the document that we intend to create. Some of the available LaTeX classes
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   187
are, ``article``, ``proc``, ``report``, ``book``, ``slides``, ``letter``.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   188
Each class has a few differences in how the content of the document is
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   189
typeset.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   190
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   191
The ``documentclass`` command also accepts a few optional parameters. For
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   192
example::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   193
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   194
  \documentclass[12pt,a4paper,oneside,draft]{report}
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   195
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   196
``12pt`` specifies the size of the main font in the document. The relative
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   197
sizes of the various fonts is maintained, when the font size is changed. If
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   198
no size is specified, ``10pt`` is assumed by default.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   199
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   200
``a4paper`` specifies the size of the paper to be used for 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
   201
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   202
``draft`` marks the hyphenation and justification problems in the document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   203
with a small square in the right hand margin of the document, so that they
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   204
can be easily spotted.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   205
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   206
Top Matter
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   207
----------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   208
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   209
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
   210
document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   211
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
   212
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   213
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   214
  \documentclass{article}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   215
  \title{A Glimpse at Scipy}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   216
  \author{FOSSEE}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   217
  \date{June 2010}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   218
  \begin{document}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   219
  \maketitle
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   220
  SciPy is open-source software for mathematics, science, and engineering.   
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   221
  \end{document}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   222
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   223
We add the title, the author and the date to the document before the
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   224
``\begin{document}`` directive. We compile the document to see if the details
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   225
appear in the document, but they donot. These details do not appear in the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   226
document until we use the ``\maketitle`` command with the document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   227
environment to instruct LaTeX to place the top matter information into the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   228
document. Now the document has these details, on compiling again.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   229
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   230
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
   231
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   232
Abstract
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   233
--------
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
   234
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   235
Next we shall add an abstract to our document. LaTeX provides an environment,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   236
for adding an abstract to the document. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   237
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   238
::
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   239
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   240
  \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
   241
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   242
  \title{A Glimpse at Scipy}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   243
  \author{FOSSEE}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   244
  \date{June 2010}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   245
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   246
  \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
   247
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   248
  \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
   249
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   250
  \begin{abstract}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   251
  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
   252
  \end{abstract}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   253
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   254
  SciPy is open-source software for mathematics, science, and engineering.   
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   255
  \end{document}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   256
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   257
The abstract environment is placed at the location where we wish it to appear
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   258
in the document.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   259
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   260
Sections
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   261
--------
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
   262
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   263
Now let's look at how to add (chapters,) sections and sub-sections to our
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   264
document. Let's add the section headings and sub headings present in our
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   265
sample document to the working copy of our document.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   266
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   267
``\section``, ``\subsection``, ``\subsubsection``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   268
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   269
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
   270
sub-sections appear in the document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   271
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   272
You may have noticed that LaTeX automatically numbers the sections. To
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   273
prevent a section from getting numbered, an asterix is appended to the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   274
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
   275
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   276
If the document was a longer document, we could have used a report or a book
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   277
class. (Note: Books donot have the abstract environment.) Let's look at what
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   278
happens to the document, when we change it to the report 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
   279
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   280
The numbering strangely begins from zero, now. This is because, chapters have
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   281
an additional sectioning command called ``\chapter``. The chapter is one
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   282
level above a section and since, our document does not have a ``\chapter``
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   283
command, the sections are numbered from 0. To change this, we add a chapter
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   284
command before the first section. We say
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   285
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   286
::
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
   287
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   288
  \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
   289
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   290
Now, observe that we now have a chapter title appearing and the numbering
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   291
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
   292
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   293
Also, note that the subsubsections donot get a numbering now. This is
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   294
controlled by a variable called the secnumdepth. By default it is set to 2.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   295
We can now, change it to 3 and get numbering for subsubsections also. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   296
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   297
::
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
   298
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   299
  \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
   300
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   301
What do you expect to happen if we changed the secnumdepth to 1? What if it
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   302
is 0 or -1?
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   303
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   304
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   305
Appendix
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
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
   309
to our document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   310
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   311
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   312
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   313
  \appendix
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   314
  \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
   315
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   316
Table of Contents
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   317
-----------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   318
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   319
Our sample document is not long enough to warrant a table of contents, but
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   320
let us learn to add a table of contents to a LaTeX document. If you ever
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   321
tried adding a table of contents, to a document in a wordprocessor, you would
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   322
know how much of a trouble it is. In LaTeX, it is a matter of just one
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   323
command and placing the command at the location where you would want to have
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   324
the table of contents. Let's now add a table of contents to our draft. Now,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   325
compile the document and look at the output document. It does not have the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   326
table of contents!
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   327
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   328
On the first compilation only the "Contents" heading appears in the document,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   329
but the actual table does not appear. You will need to compile your document
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   330
once more, for the actual table to appear in your document. On the first run,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   331
LaTeX has gone through your document and generated a temporary file
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   332
(``.toc``), with the entries that should go into the table of contents. These
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   333
entries are made, when you compile your document for the second time.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   334
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   335
Note that any section/block that has been numbered automatically appears in
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   336
the table of contents. It is possible to get un-numbered sections, for
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   337
instance a Preface or a Foreword section to appear in the Table of Contents.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   338
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   339
Let's change our Introduction section to be an un-numbered one and try to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   340
make it appear in the table-of-contents. ::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   341
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   342
  \section*{Introduction}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   343
  \addcontentsline{toc}{section}{Intro}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   344
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   345
We shall talk about adding and managing bibliographies, later in the course.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   346
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   347
Now, that we have the basic structure of the document, let's get into the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   348
content and the details of it.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   349
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
   350
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
   351
----------------
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
   352
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   353
Let's begin with adding the second paragraph to the introduction section.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   354
Let's place the text of the second para, after the first line, that we
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   355
already have. Now, compile the document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   356
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   357
As already discussed, we need to an insert an empty line, to insert a new
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   358
paragraph in LaTeX. Also, notice that the new paragraph is indented.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   359
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   360
Quotation Marks
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   361
---------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   362
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   363
Look at the quotation marks around the text, Sigh Pie. They are not formatted
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   364
properly. To place quotation marks in LaTeX, you should use ````` character
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   365
for the left quote & ``'`` character for the right quote. For double quotes,
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   366
they should be used twice.
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
Fonts
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
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   371
The names of the software tools, Scilab, Matlab, etc. appear in italics or
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   372
emphasized as it is called in LaTeX. To emphasize text, the ``\emph`` command
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   373
is used.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   374
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   375
Let's also add the contents of the subsection "Sub-packages of Scipy". We
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   376
shall add the table as plain text, until we learn how to edit tables.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   377
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   378
Let's try and form a tabular structure by separating the left and right
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   379
columns using spaces. On compiling we find that LaTeX doesn't add multiple
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   380
spaces between words. Just like multiple empty lines, multiple spaces are
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   381
considered as a single space.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   382
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   383
Also, we notice that ``LaTeX`` starts a new paragraph at the beginning of the
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   384
table. To avoid this, we use the ``flushleft`` environment.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   385
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   386
The names of the sub-packages appear in a fixed width font in the sample
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   387
document provided to us. The headings of the columns appear in bold-face.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   388
Let's make changes to this effect.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   389
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   390
``\textbf`` is used to change text to bold face and ``\texttt`` is used to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   391
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
   392
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   393
We could also change the separating - (hyphen) to an em-dash (or en-dash) --
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   394
is em-dash and --- is an em-dash, to improve the 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
   395
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   396
Lists
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   397
-----
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   398
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   399
The section on Use of Scipy in this course, contains lists. Let's now add
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   400
lists to our document. The ``enumerate`` environment adds numbered lists to
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   401
our document and the ``itemize`` environment adds un-numbered lists.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   402
``\item`` command adds a new entry to a list. Note, that LaTeX can easily
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   403
handle nested lists. In fact most environments can be embedded within other
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   404
environments, without any problems.
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   405
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   406
LaTeX also has a description list, which shall be an exercise, for you.
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   407
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   408
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   409
Footnotes, Labels and References
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   410
--------------------------------
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   411
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   412
Let's now add the footnote to pylab. LaTeX provides a footnote command to add
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   413
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
   414
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   415
We added the footnote with Appendix A, as plain text. But, in case we added
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   416
another Appendix before the section on using ``pylab``, the footnote will
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   417
have to be edited. To avoid this, LaTeX provides a handy system of labels and
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   418
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
   419
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   420
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
   421
footnote. Then, we change the footnote, and add the reference to this
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   422
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
   423
compiling the document once, you will see that the footnote has
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   424
question marks instead of the section number.  You will have to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   425
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
   426
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   427
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   428
Including code
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   429
--------------
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
   430
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   431
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
   432
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
   433
instead use an environment provided by LaTeX to include pre-formatted
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   434
text or code. LaTeX by default provides the verbatim environment to
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   435
include pre-formatted text. You can try that out during the lab
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   436
session. We shall look at using the listings package, specifically
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   437
meant for including code in our document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   438
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   439
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
   440
package in your document. We add the directive
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   441
``\usepackage{listings}`` to the preamble of our document.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   442
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   443
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
   444
our document. For this we use the lstset command.  ::
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   445
 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   446
  \lstset{language=Python,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   447
          showstringspaces=false,}
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   448
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   449
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
   450
with your embedded code, but all that during a lab exercise.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   451
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   452
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
   453
the ``\lstinline`` command. We change the name pylab in the footnote
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   454
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
   455
use the lstlisting environment (``\begin{lstlisting}`` and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   456
``\end{lstlisting}``). For example, let's add the code to the Appendix
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   457
of our document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   458
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   459
Figures, Tables and Floats
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   460
--------------------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   461
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   462
Let's now add the figure, to the appendix.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   463
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   464
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
   465
package. Add the ``\usepackage{graphicx}`` directive to the preamble
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   466
of the document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   467
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   468
To add the graphic, use the ``includegraphics`` command. The relative
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   469
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
   470
includegraphics. It takes an optional argument of scaling the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   471
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
   472
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   473
It takes other optional arguments. 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   474
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   475
  ``width=x``, ``height=x`` 
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   476
    If only the height or width is specified,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   477
    the image is scaled, maintaining the aspect ratio.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   478
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   479
  ``keepaspectratio``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   480
    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
   481
    true, the image is scaled according to both width and height,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   482
    without changing the aspect ratio, so that it does not exceed both
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   483
    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
   484
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   485
  ``angle=x``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   486
    This option can be used to rotate the image by ``x`` degrees,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   487
    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
   488
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   489
Figures (and tables) are treated specially because, they cannot be
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   490
broken across pages. They are "floated" across to the next page, if
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   491
they donot fit on the current page, filling the current page with
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   492
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
   493
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   494
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
   495
environment. For a table, the table environment should be used. We now
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   496
move our graphic into a figure environment. The figure environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   497
takes an additional parameter for the location of the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   498
float. ``\begin{figure}[hbtp!]``. The specifiers ``htbp`` are
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   499
permissions to place the float at various locations. ``t`` for top of
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   500
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
   501
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
   502
the source. ``!`` mark overrides a few of LaTeX's internal parameters
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   503
for good position of floats.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   504
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   505
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
   506
using the ``\caption`` command.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   507
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   508
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
   509
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
   510
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   511
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
   512
environment. Note, that the label to a figure should be added after
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   513
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
   514
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   515
Let us finish the appendix, by adding the content present at the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   516
beginning of the appendix. The bibliographic citations will be dealt
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   517
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
   518
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
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
   520
~~~~~~
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
   521
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   522
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
   523
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
   524
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
   525
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   526
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
   527
float, it is enclosed in the table environment. The table environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   528
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
   529
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
   530
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   531
The tabular environment takes as arguments the columns and the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   532
formatting of each column. The possible arguments to the tabular
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   533
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
   534
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   535
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   536
| ``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
   537
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   538
| ``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
   539
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   540
| ``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
   541
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   542
| ``|``         | 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
   543
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   544
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   545
It also takes an optional parameter that specifies the position of the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   546
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
   547
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   548
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
   549
separated by a new line. The ``\hline`` command allows you to draw
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   550
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
   551
you do draw partial lines. ``\cline{a-b}`` draws a horizontal line
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   552
from column ``a`` to column ``b``.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   553
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   554
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
   555
the section.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   556
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   557
You could also add a listoftables or listoffigures to the document,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   558
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
   559
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
   560
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
   561
----------------
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
   562
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   563
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
   564
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
   565
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   566
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
   567
mathematics in LaTeX. AMS-LaTeX is a collection of packages and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   568
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
   569
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   570
We load ``amsmath`` by issuing the ``\usepackage{amsmath}`` in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   571
preamble. Through out this section, it is assumed that the ``amsmath``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   572
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
   573
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   574
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
   575
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   576
To typeset math, we just have to enclose it within ``\(`` and ``\)``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   577
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
   578
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   579
To typeset the matrix A, we use the ``bmatrix`` environment. It works
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   580
similar to a tabular environment - ``&`` is used to demarcate columns
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   581
and ``\\`` is used to add a new row. ``bmatrix`` environment gives the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   582
``[`` ``]`` as delimiters. There are 5 other matrix environments
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   583
giving matrices with other delimiters - ``matrix`` (none), ``pmatrix``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   584
``(``, ``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
   585
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   586
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
   587
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
   588
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   589
This subsection doesn't have much more math. The next section on
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   590
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
   591
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   592
To typeset superscripts in LaTeX, the ``^`` character is used. The
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   593
carat operator just acts on the next character. To have multiple
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   594
characters as superscript they must be enclosed in ``{ }``. Similarly
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   595
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
   596
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   597
To typeset the summation symbol, use the command ``\sum.`` The upper
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   598
and lower limits are specified using the ``^`` and ``_``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   599
characters. Similarly, the integral symbol is obtained using the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   600
``\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
   601
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   602
Next, let us type in the equation present in the section on
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   603
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
   604
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
   605
lingo. LaTeX has a number of environments for displaying equations,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   606
with minor subtle differences. In general use ``\[`` ``\]`` to typeset
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   607
displayed equations without numbering them. ``\begin{equation*}`` is
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   608
equivalent to it.  To obtain numbered equations use
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   609
``\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
   610
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   611
Next we wish to typeset a group of equations. The equation environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   612
does not accept ``\\`` to get a new line. For multiple equations
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   613
amsmath has a handful of environments with subtle differences. We
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   614
shall use the ``eqnarray`` environment. ``eqnarray*`` environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   615
gives unnumbered equations, as expected. The ``eqnarray`` environment
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   616
works similar to a table environment. The parts of the equation that
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   617
need to be aligned are indicated using an ``&`` symbol. The
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   618
``newline`` command is used to enter a every new equation after the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   619
first one. We now typeset the equations in the section on linear
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   620
equations using the ``eqnarray`` environment. (The equations in the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   621
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
   622
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   623
We next typeset the math in the section on polynomials. To typeset
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   624
fractions use the ``\frac`` command. To typeset surds, we use the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   625
``\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
   626
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   627
Inserting Greek letters into LaTeX is simple. ``\alpha``, ``\beta``,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   628
``\gamma``, ... on for small letters and ``\Alpha``, ``\Beta``,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   629
``\Gamma``, ... for capital.
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   630
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   631
Also, math environments do not give extra spaces using the space or
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   632
tab characters. The following commands are available to specify the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   633
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
   634
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   635
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   636
| Abbrev. | Spelled out        | Example |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   637
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   638
| ``\,``  | ``\thinspace``     |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   639
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   640
| ``\:``  | ``\medspace``      |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   641
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   642
| ``\;``  | ``\thickspace``    |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   643
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   644
|         | ``\quad``          |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   645
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   646
|         | ``\qquad``         |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   647
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   648
| ``\!``  | ``\negthinspace``  |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   649
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   650
|         | ``\negmedspace``   |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   651
+---------+--------------------+---------+
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   652
|         | ``\negthickspace`` |         |
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   653
+---------+--------------------+---------+
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
   654
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   655
Bibliography
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   656
------------
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   657
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   658
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
   659
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   660
Writing bibliographies in LaTeX using the ``thebibliography``
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   661
environment is pretty easy. You simply have to list down all the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   662
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
   663
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   664
Each entry of the bibliography begins with the command
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   665
``\bibitem[label]{name}``. The name is used to cite the bibliography
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   666
item within the document using ``\cite{name}``. The label option
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   667
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
   668
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   669
The ``9`` passed as an argument to ``thebibliography`` command
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   670
indicates the maximum width of the label that the references will
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   671
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
   672
Bibliography and therefore we use 9.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   673
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   674
Presentations with Beamer
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   675
-------------------------
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   676
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   677
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
   678
the LaTeX that you have used for the report/document for the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   679
presentation as well.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   680
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   681
To write a ``beamer`` presentation, it is recommended that we use one
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   682
of the templates that beamer provides. We shall use the
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   683
``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
   684
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   685
As you can see, the document begins with the ``documentclass`` being
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   686
set to beamer.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   687
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   688
``\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
   689
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   690
``\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
   691
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   692
Notice that each slide is enclosed within ``\begin{frame}`` and
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   693
``\end{frame}`` commands. The ``\begin{frame}`` command can be passed
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   694
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
   695
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   696
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
   697
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
   698
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   699
To do overlays, use the ``\pause`` command. It does sequential
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   700
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
   701
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   702
If you have fragile environments like ``verbatim`` or ``lstlisting``,
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   703
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
   704
104
828c65311bdf Updated handout.
Puneeth Chaganti <punchagan@fossee.in>
parents: 103
diff changeset
   705
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
   706
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
   707
157
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   708
.. 
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   709
   Local Variables:
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   710
   mode: rst
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   711
   indent-tabs-mode: nil
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   712
   sentence-end-double-space: nil
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   713
   fill-column: 77
3174d4803cd5 latex: Changes to slides and handout before and after class.
Puneeth Chaganti <punchagan@fossee.in>
parents: 104
diff changeset
   714
   End: