latex/handout.rst
author Puneeth Chaganti <puneeth@fossee.in>
Fri, 18 Sep 2009 15:45:03 +0530
changeset 61 cfae54ede139
parent 56 eee394eb05fc
child 63 dc13f22e9489
permissions -rw-r--r--
minor edits to LaTeX handout and session 4.
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
------------
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
     6
LaTeX is a typesetting program used to produce excellently typeset documents. It is extensively used for producing high quality scientific and mathematical documents. It may also be used for producing other kinds of documents, ranging from simple one page articles or letters 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     7
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     8
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
     9
TeX & LaTeX
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    10
~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    11
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    12
TeX
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    13
+++
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    14
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
    15
TeX is a typesetting system designed by Donald Knuth, the renowned Computer Scientist and Emeritus professor at Stanford University. Typesetting is placing text onto a page with all the style formatting defined, so that content looks as intended. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    16
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    17
It was designed with two goals in mind-
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    18
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    19
1. To allow anybody to produce high-quality books using a reasonable amount of effort. 
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    20
2. To provide a system that would give the exact same results on all computers, now and in the future
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    21
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
    22
TeX is well known for it's stability and portability. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    23
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
    24
TeX is pronounced as "tech".
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    25
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
    26
The current version of TeX is 3.1415926 and is converging to π.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    27
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    28
LaTeX
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    29
+++++
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
    30
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    31
LaTeX was originally written by Leslie Lamport in the early 1980s. It is an extension of TeX, consisting of TeX macros and a program to parse the LaTeX files. It is easier to use than TeX itself, at the same time producing the same quality of output. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    32
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    33
LaTeX is pronounced either as "Lah-tech" or "Lay-tech"
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    34
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    35
WYSIWG vs. WYSIWM
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    36
~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    37
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
    38
WYSIWG is an acronym for "What You See Is What You Get". Word processors, are typically WYSIWG tools. LaTeX, TeX or other TeX based tools are not. They are typesetting or text formatting or document description programs. They can be called WYSIWM or "What You See Is What you Mean" systems, since you give a description of how things look, and LaTeX typesets the document for you.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    39
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
    40
Here are a few reasons, why you should use LaTeX -
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    41
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
    42
  * LaTeX produces documents with excellent visual quality, especially mathematical and scientific documents. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    43
  * It does the typesetting to you. Typically, when one works with a word-processor, the user is doing the text formatting or typesetting along with typing out the content. LaTeX allows the user to concentrate on the content leaving aside the typesetting to LaTeX. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    44
  * It is light on your resources as compared to most of the word processors available today. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    45
  * It is well known for it's stability and for it's virtually bug free code base. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    46
  * It encourages users to structure documents by meaning rather than appearance, thereby helping produce well structured documents. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    47
  * It uses plain text files as input, which have a lot of well known advantages over binary files. To state a few, they can be opened with any editor on any operating system, they are smaller in size compared to the binaries, can be version controlled and can be processed using widely used text processing utilities. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    48
  * The output can be generated in more than one formats.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    49
  * It is free software (free as in freedom) and gratis too.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    50
  * It is widely used.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    51
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
    52
Hello World
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    53
~~~~~~~~~~~
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    54
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
    55
OK, let's get started with our first LaTeX document. Open up your favorite editor and type in the following code. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    56
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    57
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    58
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    59
  %hello.tex - First LaTeX document
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    60
  \documentclass{article}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    61
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    62
  \begin{document}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    63
    Hello, World!
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    64
  \end{document}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    65
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
    66
Save the file as ``hello.tex`` and open up a terminal to compile your ``tex`` file to get the output in a ``pdf`` format. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    67
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    68
Compiling & Output
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
    69
++++++++++++++++++
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    70
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    71
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    72
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    73
  $pdflatex hello.tex
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    74
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    75
  Output written on hello.pdf (1 page, 5733 bytes).
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    76
  Transcript written on hello.log.
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    77
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
    78
Open the ``hello.pdf`` to see the output as shown. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    79
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    80
.. image:: examples/hello.jpg
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    81
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    82
Note: The command ``latex`` is often used to get the ``dvi`` output. But, throughout this course, we shall use pdflatex to compile our documents. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    83
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
    84
A peek at the source
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    85
++++++++++++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    86
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    87
``%hello.tex - First LaTeX document``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    88
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    89
  This line is a comment. LaTeX ignores this line and it is meant only for the human readers. LaTeX ignores anything after a ``%`` symbol to the end of the 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
    90
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    91
``\documentclass{article}``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    92
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    93
  This line is a command and sets the ``documentclass`` of the document to ``article``. LaTeX has other classes like ``report``, ``book``, ``letter``, etc. The typesetting of the document varies depending on the ``documentclass`` of the document. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    94
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
    95
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
    96
``\begin{document}``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    97
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    98
  This line informs LaTeX that this is the beginning of the content of the document. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
    99
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   100
``Hello, World!``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   101
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   102
  This is the actual text displayed in the document. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   103
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   104
``\end{document}``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   105
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   106
  This line tells LaTeX that the document is complete and LaTeX will simply ignore anything written after this 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
   107
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   108
Where do we want to go
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   109
~~~~~~~~~~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   110
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   111
During the course of this session we will learn how to do various things in LaTeX and try to produce the sample document provided. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   112
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   113
Some Basics
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   114
~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   115
Before we get started with creating the document, let's try to understand a few things that would be useful during the course of this session. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   116
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   117
Spaces
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   118
++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   119
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   120
LaTeX treats multiple empty spaces (or lines) as a single space (or line). An empty line between two lines of text is considered as a change of paragraphs. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   121
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   122
Line & Page Breaks
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   123
++++++++++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   124
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   125
LaTeX usually does the job of breaking up your content into lines and pages, and does it well. But under some circumstances, you might want to instruct LaTeX to break line or start a new page at a particular point. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   126
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   127
``\\`` or ``\newline`` command is used to create a new line at the point where the command is issued. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   128
Appending ``*`` to ``\\``,  instructs LaTeX to create a new line, without creating a new page at that point. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   129
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
   130
Paragraphs
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   131
++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   132
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   133
As already mentioned, LaTeX considers an empty line between two lines of text as a new paragraph. ``\par`` command may also be used to start a newline. It is equivalent to the blank 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
   134
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   135
By default LaTeX indents new paragraphs. If you do not wish to have the paragraph indented, you can use the ``\nointend`` command at the beginning of the paragraph. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   136
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   137
Special Characters
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   138
++++++++++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   139
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   140
LaTeX associates special meaning to the  characters ``~ # $ % ^ & _ { } \``. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   141
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   142
To have these characters in the text of your document, you need to prefix a backslash to them. ``\~ \# \% \$ \^ \& \_ \{ \} \textbackslash``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   143
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   144
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   145
Commands
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   146
++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   147
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   148
* All LaTeX commands start with a backslash ``\``.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   149
* Like the commands in Linux, they are case sensitive.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   150
* They usually have a backslash followed by a consisting of letters only. Any character other than letters, like space, numbers or special characters terminate the command. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   151
* The commands for producing special characters in the text, is an exception. They contain a backslash followed by a single special character.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   152
* Commands may have parameters, which are supplied to them by enclosing them in curly braces ``{ }``.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   153
* They may also have a few optional parameters which are added after the name in square brackets ``[ ]``.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   154
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   155
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   156
Environments
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   157
++++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   158
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   159
Environments are very similar to the commands, except that they effect larger parts of the document. For example, we used the ``document`` environment in our first LaTeX document. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   160
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   161
* They begin with a ``\begin`` and end with a ``\end``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   162
* In general environments can be nested within each other. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   163
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   164
Some Structural Elements
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   165
------------------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   166
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   167
``\documentclass``
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   168
~~~~~~~~~~~~~~~~~~
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
   169
As already stated, the ``documentclass`` command tells LaTeX, the type of the document that you intend to create. Each class has a few differences in how the content of the document is typeset. We presently have it set to the article class. Let us try changing it to the report class. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   170
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
   171
Note that the top matter of the document appears in a different page for the report class. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   172
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
   173
Some of the LaTeX classes that you may want to use are, article, proc, report, book, slides, letter. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   174
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   175
The ``documentclass`` command also accepts a few optional parameters. For example::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   176
  \documentclass[12pt,a4paper,oneside,draft]{report}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   177
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
   178
``12pt`` specifies the size of the main font in the document. The relative sizes of the various fonts is maintained, when the font size is changed. If no size is specified, ``10pt`` is assumed by default. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   179
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   180
``a4paper`` specifies the size of the paper to be used for the document. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   181
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
   182
``oneside`` specifies that the document will be printed only on one side of the paper. The ``article`` and ``report`` classes are ``oneside`` by default and the ``book`` class is ``twoside``.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   183
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
   184
``draft`` marks the hyphenation and justification problems in the document with a small square in the right hand margin of the document, so that they can be easily spotted. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   185
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   186
Note: Everything written in between the ``\documentclass`` command and the ``\begin{document}`` command is called the Preamble. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   187
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   188
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
   189
Parts, Chapters and Sections
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   190
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   191
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
   192
Often documents are divided into various parts, chapters, sections and subsections. LaTeX provides an intuitive mechanism to include this in your documents. It has various commands like ``part``, ``chapter``, ``section``, ``subsection``, ``subsubsection``, ``paragraph`` and ``subparagraph``. Note that all these commands are not available in all the document classes. The ``chapter`` command is available only in books and reports. Also, the ``letter`` document class does not have any of these commands. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   193
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
   194
Let us now give our document some structure, using these commands. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   195
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
   196
Note that you do not need to provide any numbers to the commands. LaTeX automatically takes care of the numbering. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   197
Also, you do not need to enclose the text of a block within ``\begin`` and ``\end`` commands. LaTeX starts a new block each time it finds a sectioning command. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   198
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   199
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
   200
  \section[Short Title]{This is a very long title and the Short Title will appear in the Table of Contents.}
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
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   202
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   203
Section Numbering
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   204
+++++++++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   205
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   206
As already, you don't need to explicitly do any numbering in LaTeX. Parts are numbered using roman numerals; Chapters and sections are numbered using decimal numbers. When the table of contents is inserted into a document, all the numbered headings automatically appear in it.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   207
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
   208
By default LaTeX has numbering up 2 levels, i.e, the parts, chapters, sections and subsections are numbered. You can change this by setting the ``secnumdepth`` counter using the ``\setcounter`` command. The following command removes numbering of the subsections. Only parts, chapters and sections are numbered. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   209
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   210
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   211
  \setcounter{secnumdepth}{1}
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
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   213
A sectioning command appended with an asterisk gives an unnumbered heading that is not included in the table of contents.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   214
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   215
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   216
  \section*{Introduction}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   217
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   218
Top Matter
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   219
~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   220
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
   221
The information about the document such as it's title, the date, the author(s) information etc, is collectively known as the topmatter. Though there is no command called ``topmatter``, the term topmatter is frequently used in LaTeX documentation. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   222
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
   223
Let us input the top matter for our document now. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   224
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   225
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
   226
  \title{LaTeX - A How-to}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   227
  \author{The FOSSEE Team}
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
   228
  \date
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   229
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
   230
The  commands ``\title`` and  ``\author`` are self explanatory. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   231
The ``\date`` command automatically puts in today's date into the document. Now let us compile and look at the result. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   232
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
   233
You would observe that the details do not appear in the document after recompilation. This is because, LaTeX has not been instructed what to do with the top matter information that you have given it. Use the ``\maketitle`` command within the document environment to instruct LaTeX to place the top matter information into the document. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   234
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   235
Abstract
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   236
~~~~~~~~
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
   237
Lets now place and abstract in the document using the ``abstract`` environment of LaTeX. The abstract appears in the document after the topmatter but before the main body of the document. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   238
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   239
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   240
  \begin{abstract}
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
   241
  The abstract abstract.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   242
  \end{abstract}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   243
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   244
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   245
Appendices
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   246
~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   247
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
   248
LaTeX allows for separate numbering for appendices. ``\appendix`` command indicates that the sections following are to be included in the appendix. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   249
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   250
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   251
  \appendix
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   252
  \chapter{First Appendix}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   253
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   254
Table of Contents
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   255
~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   256
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
   257
Parts, chapters or sections that have been auto numbered by LaTeX automatically appear in the Table of Contents (ToC). ``\tableofcontents`` command places a the ToC, where the command has been issued. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   258
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
   259
The counter ``tocdepth`` specifies the depth up to which headings appear in the ToC. It can be set using the ``\setcounter`` command as shown below. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   260
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   261
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   262
  \setcounter{tocdepth}{3}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   263
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
   264
Unnumbered sections can be placed in the table of contents using the ``\addcontentsline`` command as shown below.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   265
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   266
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   267
  \section*{Introduction}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   268
  \addcontentsline{toc}{section}{Introduction}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   269
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
   270
Note: To get the correct entries in your table of contents, you will need to run one extra compilation, each time. This is because, the entries of the table of contents are collected during each compilation of the document and utilized during the next compilation. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   271
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
   272
Elementary Text Typesetting
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   273
---------------------------
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   274
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
   275
Emphasizing
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   276
~~~~~~~~~~~
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   277
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   278
*Italic* font is generally used to emphasize text. The ``\emph`` command may be used to achieve this effect in LaTeX.
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
   279
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   280
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
   281
  This is the \emph{emphasized text}.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   282
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
   283
If the ``\emph`` command is nested within another emphasize command, LaTeX emphasized that text using normal fonts. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   284
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   285
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
   286
  \emph{Did you wonder what happens when we try \emph{emphasizing text} within \emph{emphasized text}}?
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   287
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
   288
*This is emphasized text, and* this is emphasized text with normal font *, within* emphasized text.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   289
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   290
Quotation Marks
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
   291
~~~~~~~~~~~~~~~
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   292
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
   293
When typing in LaTeX, the double quotation mark ``"`` character shouldn't be used. The grave accent ````` character produces the left quote and the apostrophe ``'`` character produces the right quote. To obtain double quotes they are, each, used twice. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   294
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   295
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   296
  `` Here is an example of putting `text' in quotes ''
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   297
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
   298
Dashes and Hyphens
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   299
~~~~~~~~~~~~~~~~~~
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   300
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
   301
LaTeX has four dashes of different lengths. Three of them can be produces with different number of consecutive dashes. The short dashes are used for hyphens, slightly longer ones for number ranges and the longest ones for comments. The fourth one is a mathematical symbol, the minus sign. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   302
::
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
  The names of these dashes are: `-' hyphen, `--' en-dash, `---' em-dash and `$-$' minus sign.
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   305
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   306
The names for these dashes are: ‘‐’ hyphen, ‘–’ en-dash, ‘—’ em-dash and ‘−’ minus sign.
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   307
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   308
Footnotes
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   309
~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   310
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   311
With the command::
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
  \footnote{footnote text}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   314
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   315
a footnote is printed at the foot of the current page. Footnotes should always be put after the word or sentence they refer to. Footnotes referring to a sentence or part of it should therefore be put after the comma or period.
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   316
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
   317
Note: Look at the ``\marginpar`` command to insert margin notes
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   318
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   319
Flushleft, Flushright, and Center
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   320
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   321
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
   322
The environments ``flushleft`` and ``flushright`` generate paragraphs that are either left- or right-aligned. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   323
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   324
The ``center`` environment generates centered text.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   325
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   326
Itemize, Enumerate, and Description
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   327
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   328
LaTeX has three different environments for producing lists. Itemize, Enumerate and Description allow you to produce lists of various types in LaTeX. 
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
   329
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   330
Itemize is used to produce unnumbered lists. The bullets of the list can be easily changed to use any character. Enumerate environment allows you to produce auto-numbered lists. The description environment, allows you to produce a list of definitions. These environments can be nested within each other, easily. 
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
   331
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   332
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   333
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
   334
  \begin{itemize}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   335
    \item Now we move onto some elementary \emph{Text Typesetting}.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   336
    \item How do we get \emph{emphasized or italic text}?
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   337
    \item \emph{Did you wonder what happens when we try \emph{emphasizing text} within \emph{emphasized text}}?
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   338
    \item ``Beautiful is better than ugly.''
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   339
  \end{itemize}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   340
  
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   341
  \begin{description}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   342
    \item[Description] This list is a description list. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   343
    \item[Enumerate] Numbered lists are often useful.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   344
      \begin{enumerate}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   345
      \item First
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   346
      \item Second
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   347
      \item Third
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   348
      \item \ldots
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   349
      \end{enumerate}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   350
    \item[Itemize] The list above this description list is an itemize list.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   351
  \end{description}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   352
  
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   353
Quote, Quotation, and Verse
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   354
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   355
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
   356
LaTeX provides a ``quote`` environment that can be used for quoting, highlighting important material, etc. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   357
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   358
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
   359
  The Zen of Python
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   360
  \begin{quote}
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
   361
    The Zen of Python, by Tim Peters
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   362
    
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   363
    Beautiful is better than ugly.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   364
    Explicit is better than implicit.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   365
    Simple is better than complex.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   366
    Complex is better than complicated.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   367
    Flat is better than nested.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   368
    Sparse is better than dense.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   369
    Readability counts.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   370
    Special cases aren't special enough to break the rules.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   371
    Although practicality beats purity.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   372
    Errors should never pass silently.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   373
    Unless explicitly silenced.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   374
    In the face of ambiguity, refuse the temptation to guess.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   375
    There should be one-- and preferably only one --obvious way to do it.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   376
    Although that way may not be obvious at first unless you're Dutch.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   377
    Now is better than never.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   378
    Although never is often better than *right* now.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   379
    If the implementation is hard to explain, it's a bad idea.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   380
    If the implementation is easy to explain, it may be a good idea.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   381
    Namespaces are one honking great idea -- let's do more of those!
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   382
  \end{quote}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   383
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
   384
LaTeX provides two other similar environments, the quotation and the verse environments. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   385
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
   386
The quotation environment can be used for longer quotes which have several paragraphs, since it indents the first line of each paragraph. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   387
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
   388
The verse environment may be used to quote verses or poems, since the line breaks are important in quoting them. The lines are separated using ``\\\\`` at the end of a line and an empty line after each verse. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   389
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   390
Verbatim
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   391
~~~~~~~~
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
The verbatim environment allows us to insert pre-formatted text in a LaTeX document. It is useful for inserting code samples within the document. The verbatim text needs to be enclosed between ``\begin{verbatim}`` and ``\end{verbatim}``. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   393
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   394
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   395
  \begin{verbatim}
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   396
  from numpy import *
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   397
  a = linspace(0, 5, 50, endpoint = False)
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   398
  \end{verbatim}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   399
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   400
  from numpy import *
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   401
  a = linspace(0, 5, 50, endpoint = False)
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   402
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   403
To insert verbatim text in-line, the ``\verb`` command can be used. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   404
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   405
  
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   406
 The verb command allows placing \verb|verbatim text| in-line. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   407
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
   408
The | is just an example of a delimiter character. You can use any character except letters, * or space.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   409
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   410
Tables, Figures and Captions
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   411
----------------------------
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   412
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   413
The ``\tabular`` environment
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   414
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   415
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
   416
The ``tabular`` environment allows you to typeset tables in LaTeX. ``\begin{tabular}[pos]{col fmt}`` command can be used to specify the parameters of the table and start creating the table. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   417
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   418
The ``pos`` argument specifies the vertical position of the table relative to the baseline of the surrounding text. It can take on the values ``t`` for top, ``b`` for bottom, or ``c`` for center. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   419
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   420
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   421
The ``col fmt`` argument specifies the formatting of the columns of the table. You need to explicitly specify the formatting for each of the columns in the table. The ``col fmt`` argument can take on the following values. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   422
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   423
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   424
| ``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
   425
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   426
| ``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
   427
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   428
| ``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
   429
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   430
| ``*{n}{col}`` | produces ``n`` columns with the    |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   431
|               | ``col`` type of formatting         |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   432
|               | ``*{3}{c}`` is the same as {c c c} |
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   433
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   434
| ``|``         | 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
   435
+---------------+------------------------------------+
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   436
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   437
Now we look at how to input the actual entries of the tables. Each horizontal row in a table is separated by ``\\``. Each column entry of a row is separated by ``&``. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   438
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   439
The ``\hline`` command allows you to draw horizontal lines between two rows of the table. But it does not allow you do draw partial lines. ``\cline{a-b}`` draws a horizontal line from column ``a`` to column ``b``.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   440
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   441
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
   442
  \begin{tabular}{|c|c|}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   443
    \hline
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   444
    \verb+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
   445
    \hline
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   446
    \verb+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
   447
    \hline
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   448
    \verb+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
   449
    \hline
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   450
    \verb+*{n}{col}+ & produces \verb+n+ columns with the\\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   451
                   & \verb+col+ type of formatting\\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   452
    \cline{2-2}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   453
                   &\verb+*{3}{c}+ is the same as \verb+{c c c}+ \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   454
    \hline
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   455
    \verb+|+ & 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
   456
    \hline
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   457
  \end{tabular}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   458
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   459
Importing Graphics
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   460
~~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   461
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
   462
To include images in LaTeX, we require to use an additional package known as ``graphicx``.  To load a package, we use the ``\usepackage`` directive in the preamble of the document.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   463
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   464
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   465
  \usepackage{graphicx}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   466
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
   467
When compiling with ``pdflatex`` command,  **jpg**, **png**, **gif** and **pdf** images can be inserted. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   468
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   469
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   470
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   471
  \includegraphics[optional arguments]{imagename}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   472
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   473
A few ``optional arguments``:
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   474
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
   475
  ``width=x``, ``height=x``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   476
    If only the height or width is specified, the image is scaled, maintaining the aspect ratio.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   477
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   478
  ``keepaspectratio``
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
   479
    This parameter can either be set to true or false. When set to true, the image is scaled according to both width and height, without changing the aspect ratio, so that it does not exceed both the width and the height dimensions. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   480
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   481
  ``scale=x``
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   482
    Scale the image by a factor of ``x``. For example, ``scale=2``, will double the image size. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   483
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
   484
  ``angle=x``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   485
    This option can be used to rotate the image by ``x`` degrees, counter-clockwise. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   486
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
   487
::
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   488
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
   489
  \includegraphics[scale=0.8, angle=30]{lion_orig.png}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   490
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   491
Floats
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   492
~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   493
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
   494
Tables and Figures need to be treated in a special manner, since they cannot be split over pages, and they are referred to as floats in LaTeX. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   495
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
   496
When there is not enough space on a page, to fit in a table or figure, it is floated over to the next page filling up the current page with text. LaTeX has float environments called table and figure for tables and images, respectively.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   497
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
   498
Anything enclosed within the table or figure environments will be treated as floats.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   499
::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   500
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
   501
  \begin{figure}[pos] or 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   502
  \begin{table}[pos]
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   503
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
   504
The ``pos`` parameter specifies the placement of the float. The possible values it can take are as follows. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   505
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   506
+-----------+-------------------------------------------------------------------+
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   507
| Specifier | Permission                                                        |
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   508
+===========+===================================================================+
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
   509
|   h       |  at approximately the same place where it occurs in the source    |
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   510
+-----------+-------------------------------------------------------------------+
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
   511
|   t       |  at the top of the page.                                          |
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   512
+-----------+-------------------------------------------------------------------+
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
   513
|   b       |  at the bottom of the page.                                       |
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   514
+-----------+-------------------------------------------------------------------+
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
   515
|   p       |  on a special page for floats only.                               |
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   516
+-----------+-------------------------------------------------------------------+
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
   517
|   !       |  Override LaTeX's internal parameters for good positions          |
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   518
+-----------+-------------------------------------------------------------------+
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
   519
|   H       |  nearly equivalent to h!                                          |
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   520
+-----------+-------------------------------------------------------------------+
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   521
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   522
Examples::
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   523
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
   524
  \begin{figure}[h]
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   525
  \centering
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   526
  \includegraphics[scale=0.8, angle=30]{lion_orig.png}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   527
  \end{figure}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   528
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   529
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   530
Captions
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   531
~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   532
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
   533
The ``\caption{text}`` command allows you to add captions to images or tables. LaTeX automatically numbers your tables and figures and you need not include numbers in the captions that you write. The caption appears below or on top of the image (or table), depending on whether you place it after or before the ``importgraphics`` (or ``tabular``) command. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   534
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   535
::
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
   536
  \begin{figure}[h]
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
  \centering
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
  \includegraphics[scale=0.8]{lion_orig.png}
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
  \caption{CTAN lion drawing by Duane Bibby; thanks to www.ctan.org}
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   540
  \end{figure}
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   541
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
   542
The caption command also, like the section command, has the short caption optional parameter. The short caption will appear in the list of tables or figures. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   543
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   544
List of Figures, Tables
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   545
~~~~~~~~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   546
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
   547
LaTeX can automatically generate a List of Tables or Figures, with the table or figure numbers, the captions and page numbers on which they appear. This can be done using the ``\listoftables`` or ``listoffigures`` commands. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   548
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
   549
Note: Just like table of contents, these lists also require an extra compilation. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   550
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
   551
Cross References
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   552
~~~~~~~~~~~~~~~~
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   553
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
   554
LaTeX has a very efficient mechanism of inserting cross-references in documents. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   555
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
   556
The command ``\label{name}`` is used to label figures, tables or segments of text. ``\ref{name}`` refers to the object marked by the ``name`` by it's numbering (figure, table, section etc.) ``\pageref{name}`` gives the page number of the object which has been labeled with ``name``. 
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   557
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
   558
Note: Cross referencing also requires an extra compilation, like table of contents. 
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   559
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   560
Bibliography
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   561
------------
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   562
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
   563
Bibliography or references can be added to LaTeX documents in two ways - using the ``thebibliography`` environment, or using BibTeX. Let's first look at using the ``\thebibliography`` environment and then move on to BibTeX.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   564
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   565
``thebibliography`` environment
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   566
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   567
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
   568
Writing bibliographies in LaTeX using the ``thebibliography`` environment is pretty easy. You simply have to list down all the bibliography items within the bibliography environment. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   569
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   570
Each entry of the bibliography begins with the command ``\bibitem[label]{name}``. The name is used to cite the bibliography item within the document using  ``\cite{name}``. The label option replaces the numbers from the auto enumeration with the labels given. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   571
::
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   572
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
   573
  He used this lion in the illustrations for D Knuth's original TeXbook\cite{DKnuth}, for L Lamport's LaTeX book\cite{LLamport}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   574
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   575
  \begin{thebibliography}{99}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   576
    \bibitem{DKnuth} Donald E. Knuth (1984). \emph{The TeXbook} (Computers and Typesetting, Volume A). Reading, Massachusetts: Addison-Wesley. ISBN 0-201-13448-9.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   577
  
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
   578
    \bibitem{LLamport} Lamport, Leslie (1994). \emph{LaTeX: A document preparation system: User's guide and reference}.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   579
     illustrations by Duane Bibby (2nd ed.). Reading, Mass: Addison-Wesley Professional. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   580
  \end{thebibliography}
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   581
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   582
The ``99`` in the example above indicates the maximum width of the label that the references may get. We here assume that the number of Bibliography items will be less than 100. If your document has less than 10 references, you may want to replace ``99`` with ``9``. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   583
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   584
BibTeX
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   585
~~~~~~
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   586
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
   587
The previous section explained the process of listing references at the end of a document and embedding cross references. In this section let us explore the BibTeX environment for keeping track of references.
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   588
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
   589
Using BibTeX is a very convenient method to use, when writing multiple documents in a single area or field. BibTeX allows you to create a database of all your references and use them as and when required. 
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   590
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   591
The BibTeX database is stored in a ``.bib`` file. The structure of the file is quite simple and an example is shown below. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   592
::
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   593
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   594
  @book{Lamport94,
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   595
  author    = "Leslie Lamport",
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   596
  title     = "A Document Preparation System: User's Guide and Reference",
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   597
  publisher = "Addison-Wesley Professional",
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   598
  year      = "1994",
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
   599
  edition    = "second",
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   600
  note      = "illustrations by Duane Bibby"
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   601
  }
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   602
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   603
Each bibliography entry starts with a declaration of the type of the reference being mentioned. The reference is in the above example is of the book type. BibTeX has a wide range of reference types, for example, ``article, book, conference, manual, proceedings, unpublished``.
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   604
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   605
The type of reference is followed by a left curly brace, and immediately followed by the citation key. The citation key, ``Lamport94`` in the example above is used to cite this reference using the command ``\cite{Lamport94}``. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   606
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   607
This is followed by the relevant fields and their values, listed one by one. Each entry must be followed by a comma to delimit one field from the other. 
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   608
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   609
To get your LaTeX document to use the bibliography database, you just add the following lines to your LaTeX document. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   610
::
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   611
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   612
  \bibliographystyle{plain}
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   613
  \bibliography{LaTeX}
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   614
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   615
Bibliography styles are files that tell BibTeX how to format the information stored in the ``.bib`` database file. The style file for this example is ``plain.bst``. Note that you do not need to add the ``.bst`` extension to the filename.  If you wish to achieve a particular style of listing the bibliography items and citing them, you should use an appropriate style file. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   616
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   617
The ``bibliography`` command specifies the file that should be used as the database for references. The file used in this example is ``LaTeX.bib``
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   618
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   619
Compiling
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   620
+++++++++
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   621
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
   622
Adding BibTeX based references, slightly complicates the process of compiling the document to obtain the desired output. The exact workings of LaTeX and BibTeX will not be explained here. The procedure for obtaining the output (without any explanations) is as follows:
36
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   623
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   624
1. Compile the ``.tex`` file using ``pdflatex`` - ``$pdflatex LaTeX(.tex)``
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   625
2. Compile the ``.bib`` file using ``bibtex`` -  ``$bibtex LaTeX(.bib)``
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   626
3. Compile the ``.tex`` file again. 
4c4c8a9795b2 Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents: 30
diff changeset
   627
4. Compile the ``.tex`` file for one last time!
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   628
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
   629
Typesetting Math
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   630
----------------
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   631
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   632
It is advisable to use the AMS-LaTeX bundle to typeset mathematics in LaTeX. It is a collection of packages and classes for mathematical typesetting. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   633
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   634
We load ``amsmath`` by issuing the ``\usepackage{amsmath}`` in the preamble. Through out this section, it is assumed that the ``amsmath`` package has been loaded. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   635
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   636
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   637
Math Mode
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   638
~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   639
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   640
There are a few differences between the *math mode* and the *text mode*:
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   641
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   642
1. Most spaces and line breaks do not have any significance, as all spaces are either derived logically from the mathematical expressions, or have to be specified with special commands such as ``\``, ``\quad`` or ``\qquad``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   643
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   644
2. Empty lines are not allowed.  
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   645
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   646
3. Each letter is considered to be the name of a variable and will be typeset as such. If you want to typeset normal text within a formula, then you have to enter the text using the \text{...} command
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   647
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   648
Single Equations
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   649
~~~~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   650
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   651
Mathematical equations can be inserted in-line within a paragraph (*text style*), or the paragraph can be broken to typeset it separately (*display style*). 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   652
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   653
A mathematical equation within a paragraph is entered between ``$`` and ``$``. Larger equations are set apart from the paragraph, by enclosing them within ``\begin{equation}`` and ``\end{equation}``. If you don't wish to number a particular equation, the starred version of equation can be used. ``\begin{equation*}`` and ``\end{equation*}``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   654
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   655
The equation can also be cross referenced using the ``\label`` and ``\eqref`` commands. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   656
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   657
Basic Elements
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   658
~~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   659
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   660
Greek Letters can are entered as ``\alpha, \beta, \gamma, \delta, ...`` for lowercase letters and ``\Alpha, \Beta, \Gamma, ...`` for uppercase ones. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   661
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   662
Exponents and subscripts can be typeset using the carat ``^`` and the underscore ``_`` respectively. Most of the math mode commands act only on the next character. If you want a command to affect several characters, they need to be enclosed in curly braces. 
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
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   664
The ``\sqrt`` command is used to typeset the square root symbol. LaTeX of the root sign is determined automatically. The nth root is generated with ``\sqrt[n]``. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   665
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   666
To explicitly show a multiplication a dot may be shown. ``\cdot`` could be used, which typesets the dot to the center. ``\cdots`` is three centered dots while ``\ldots`` sets the dots on the baseline. Besides that ``\vdots`` for vertical and ``\ddots`` can be used for diagonal dots.
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
   667
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   668
A fraction can be typeset with the command ``\frac{..}{..}``
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   669
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   670
The integral operator is generated with ``\int``, the sum operator with ``\sum``, and the product operator with ``\prod``. The upper and lower limits are specified with ``^`` and ``_`` like subscripts and superscripts.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   671
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   672
LaTeX provides all kinds of braces as delimiters. The round and square brackets can be produces using the keys on the keyboard and appending a backslash. Other delimiters can be produced using special commands of LaTeX. Placing ``\left`` in front of an opening delimiter and ``\right`` in front of a closing delimiter, instructs LaTeX to automatically take care of the sizes of the delimiters. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   673
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   674
Multiple Equations
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   675
~~~~~~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   676
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   677
Long formulae that run over several lines or equation systems, can be typeset using the ``align`` or ``align*`` environments. ``align`` numbers each of the lines in the environment, and ``align*`` as expected, does not number any of them. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   678
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   679
The ``&`` is used to align the equations vertically and the ``\\`` command is used to break the lines. Line numbering can be skipped for a particular line in the ``align`` environment by placing a ``\nonumber`` before the line break.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   680
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   681
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   682
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   683
  \begin{align}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   684
  \alpha^2 + \beta^2 &= \gamma^2 \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   685
  \sum_{i=1}^ni &= \frac{n(n+1)}{2}\\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   686
  \sqrt{-1} &= \pm1 \nonumber
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   687
  \end{align}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   688
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   689
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   690
Arrays and Matrices
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
~~~~~~~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   692
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   693
To typeset arrays, use the ``array`` environment. It works similar to the ``tabular`` environment. The ``\\`` command is used to break the lines. 
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
   694
::
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
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   696
  \begin{equation*}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   697
  \mathbf{X} = \left(
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
   \begin{array}{ccc}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   699
   a_1 & a_2 & \ldots \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   700
   b_1 & b_2 & \ldots \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   701
   \vdots & \vdots & \ddots
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   702
   \end{array} \right)
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   703
  \end{equation*}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   704
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   705
The ``array`` environment can also be used to typeset piecewise functions by using a “.” as an invisible ``\right`` delimiter
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   706
::
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
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   708
  \begin{equation*}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   709
  f(x) = \left\{
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   710
   \begin{array}{rl}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   711
     0 & \text{if } x \le 0\\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   712
     1 & \text{if } x > 0
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   713
   \end{array} \right.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   714
   \end{equation*}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   715
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   716
Six different types of matrix environments are available in the ``amsmath`` package for typesetting matrices.  They essentially have different delimiters: ``matrix`` (none), ``pmatrix`` (, ``bmatrix`` [, ``Bmatrix`` {, ``vmatrix`` | and ``Vmatrix`` ‖. In these matrix environments, the number of columns need not be specified, unlike the ``array`` environment.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   717
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   718
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   719
  \begin{equation*}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   720
    \begin{matrix}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   721
    1 & 2 \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   722
    3 & 4
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   723
    \end{matrix} \qquad
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   724
 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   725
    \begin{bmatrix}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   726
    1 & 2 & 3 \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   727
    4 & 5 & 6 \\
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   728
    7 & 8 & 9
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   729
    \end{bmatrix}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   730
  \end{equation*}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   731
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   732
Miscellaneous Stuff
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   733
-------------------
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   734
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   735
Presentations
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   736
~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   737
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   738
LaTeX has quite a few options to produce presentation slides. We shall look at the ``beamer`` class, which is well developed and easy to use. We shall only briefly look at some of the features of beamer. For the best documentation, look at the beamer user guide.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   739
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   740
To write a ``beamer`` presentation, it is recommended that you use one of the templates that beamer provides. We shall use the ``speaker_introduction`` template to get started with beamer. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   741
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   742
As you can see, the document begins with the ``documentclass`` being set to beamer. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   743
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   744
The ``\setbeamertemplate`` command sets the template for various parameters. The ``background canvas``, ``headline`` and ``footline`` are being set using the command.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   745
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   746
``\usetheme`` command sets the theme to be used in the presentation. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   747
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   748
Notice that each slide is enclosed within ``\begin{frame}`` and ``\end{frame}`` commands. The ``\begin{frame}`` command can be passed the Title and Subtitle of the slide as parameters. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   749
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   750
To achieve more with beamer, it is highly recommended that you look at the ``beameruserguide``.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   751
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   752
Including Code
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   753
~~~~~~~~~~~~~~
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   754
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   755
The ``listings`` package can be used to embed source code into your LaTeX document. We shall briefly explore inserting python code into our document. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   756
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   757
Obviously, you first need to tell LaTeX that you want it to use the ``listings`` package, using the ``\usepackage`` command. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   758
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   759
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   760
  \usepackage{listings}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   761
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   762
Then, we tell LaTeX that we are going to embed Python code into this document. A simple code highlighting for Python code can be achieved using this. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   763
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   764
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   765
  \lstset{language=Python,
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   766
          showstringspaces=false,
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   767
         }
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   768
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   769
You might want to customize the code highlighting further using other variables like ``basicstyle``, ``commentstyle``, ``stringstyle``, ``keywordstyle`` etc. For detailed information on all this, you should look at the ``listings`` package documentation. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   770
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   771
You include a block of code into your document by enclosing it within the ``lstlisting`` environment. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   772
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   773
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   774
  \begin{lstlisting}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   775
  string="Hello, World! "
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   776
  for i in range(10):
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   777
      print string*i
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   778
  \end{lstlisting} 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   779
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   780
You can also include source code files directly into your latex document, using the ``lstinputlisting`` command. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   781
::
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   782
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   783
  \lstinputlisting[lastline=20]{lstexample.py}
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   784
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   785
This command includes the first 20 lines of the file ``lstexample.py`` into out LaTeX document. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   786
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   787
Including files
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   788
~~~~~~~~~~~~~~~
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   789
When working on a large document, it is convenient sometimes, to split the large file into smaller input files and club them together at the time of compiling. 
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
   790
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   791
The ``\input`` or ``\include`` commands may be used to embed one LaTeX file into another. The ``\input`` command is equivalent to a copy and paste of the document, just before the compilation. The ``\include`` command is exactly similar, except for the fact that it creates a new page every time it is issued.
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   792
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   793
``\input{file}`` or ``\include{file}`` commands will include the file ``file1.tex`` with in the file where the command has been issued. Note that you do not need to specify the ``.tex`` extension of the file. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   794
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   795
The ``\includeonly`` is useful for debugging or testing the LaTeX document that you are creating, since it restricts the ``\include`` command. Only the files which are given as arguments to the ``\includeonly`` command will be included in the document (wherever a ``\include`` command for those files, has been issued).
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   796
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   797
A note on filenames
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   798
+++++++++++++++++++
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   799
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   800
Never use filenames or directories that contain spaces. Make filenames as long or short as you would like, but strictly avoid spaces. Stick to upper or lower case letters (without accents), the digits, the hyphen and the full stop or period.
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   801
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   802
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   803
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   804
Recommended Reading
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   805
===================
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   806
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   807
1. *LaTeX Wikibook*
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   808
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
   809
2. *The Not So Short Introduction to LaTeX2e* by Tobias Oetikar et al.. 
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   810
30
3ca8ab883c13 First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff changeset
   811
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
   812
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   813
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   814
eee394eb05fc Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents: 36
diff changeset
   815
61
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   816
..  LocalWords:  LaTeX Lamport tex documentclass pdf pdflatex dvi topmatter ToC
cfae54ede139 minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents: 56
diff changeset
   817
..  LocalWords:  FOSSEE tocdepth addcontentsline toc emph