author | Puneeth Chaganti <punchagan@gmail.com> |
Wed, 02 Jun 2010 21:31:35 +0530 | |
changeset 101 | e529bec52b6f |
parent 63 | dc13f22e9489 |
child 103 | 313bebeb7862 |
permissions | -rw-r--r-- |
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 |
------------ |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
6 |
LaTeX is a typesetting program that produces excellently typeset documents. Typesetting is placing text onto a page with all the style formatting defined, so that content looks as intended. It is extensively used for producing high quality scientific and mathematical documents. It is also used for producing other kinds of documents, ranging from simple one page articles or letters to books. LaTeX is based on the TeX typesetting language. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
7 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
8 |
TeX |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
9 |
~~~ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
10 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
11 |
TeX is a typesetting system designed and developed by Donald E. Knuth, the renowned Computer Scientist and Emeritus professor at Stanford University. |
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
|
12 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
13 |
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
|
14 |
|
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
15 |
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
|
16 |
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
|
17 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
18 |
TeX is well known for it's stability and portability. TeX is known to be virtually bug free. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
19 |
|
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
|
20 |
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
|
21 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
22 |
LaTeX |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
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 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
25 |
LaTeX is an extension of TeX, consisting of TeX macros and a program to parse the LaTeX files. It is supposed to be an easier to use language than TeX, but producing the same quality of output. It was developed by Leslie Lamport in the early 1980s and is now being maintained and developed by the LaTeX3 Project. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
26 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
27 |
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
|
28 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
29 |
Why should you use it? |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
30 |
~~~~~~~~~~~~~~~~~~~~~~ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
31 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
32 |
A few reasons for using LaTeX - |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
33 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
34 |
* It produces documents with excellent visual quality. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
35 |
* It does the typesetting for you, leaving you - the author - to focus on writing the content. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
36 |
* It makes writing math just as easy as writing simple text. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
37 |
* It's renowned for it's stability and a virtually bug free code base. |
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 |
* It is light on your resources as compared to most of the word processors available today. |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
39 |
* It uses plain text files as input and can give output in a variety of formats including PDFs and html making it platform independent. |
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
40 |
* It is free software (free as in freedom) and gratis too. |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
41 |
* It is widely used and has a large user community. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
42 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
43 |
First Document |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
44 |
-------------- |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
45 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
46 |
Let's begin by writing a simple LaTeX, Hello World, document. The following code is typed out into a text editor. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
47 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
48 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
49 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
50 |
%hello.tex - The Hello World of LaTeX |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
51 |
\documentclass{article} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
52 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
53 |
\begin{document} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
54 |
Hello, World! |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
55 |
\end{document} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
56 |
|
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
|
57 |
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
|
58 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
59 |
Compiling & Output |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
60 |
~~~~~~~~~~~~~~~~~~ |
30
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 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
63 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
64 |
$pdflatex hello.tex |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
65 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
66 |
Output written on hello.pdf (1 page, 5733 bytes). |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
67 |
Transcript written on hello.log. |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
68 |
|
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 |
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
|
70 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
71 |
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
|
72 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
73 |
What does it mean? - Understanding the source |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
74 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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
|
75 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
76 |
``%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
|
77 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
78 |
The first line is a comment. It is meant only for human readers and LaTeX simply ignores that line. Anything following a ``%`` symbol, until the end of the line, is ignored by 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
|
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 |
``\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
|
81 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
82 |
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
|
83 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
84 |
|
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
|
85 |
``\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
|
86 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
87 |
This line informs LaTeX that this is the beginning of the content of the document. The command, technically speaking, marks the beginning of the ``document`` environment. |
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
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 |
``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
|
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 |
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
|
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 |
``\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
|
94 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
95 |
The end command marks the end of the ``document`` environment. It tells LaTeX that the document is complete and LaTeX will simply ignore anything written after this line. |
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 |
|
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 |
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
|
98 |
~~~~~~~~~~~ |
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 |
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
|
101 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
102 |
In order to explicitly instruct LaTeX to start a new-line, ``\\`` or ``\newline`` command is used. Appending ``*`` to ``\\``, instructs LaTeX to create a new line, without creating a new page at that point. |
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
103 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
104 |
As already mentioned, ``%`` symbol marks the beginning of a comment. How would we then use it in our document's text? ``%`` is one of the many special characters and is used by escaping it with a backslash, as shown. Other special characters are ``~ # $ ^ & _ { } \``. All of them, except the backslash character, can be inserted in the document by escaping them with a ``\`` character. To insert the ``\`` character, ``\textbackslash`` must be used. |
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
|
105 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
106 |
:: |
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
|
107 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
108 |
%hello.tex - First LaTeX document |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
109 |
\documentclass{article} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
110 |
\begin{document} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
111 |
Hello, World! |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
112 |
This will not start a new line. |
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
|
113 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
114 |
But, this will start a new paragraph. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
115 |
Again no new line. \% what follows isn't a comment. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
116 |
\end{document} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
117 |
This is text that is ignored. |
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
|
118 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
119 |
Basic Structure |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
120 |
--------------- |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
121 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
122 |
``\documentclass`` |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
123 |
~~~~~~~~~~~~~~~~~~ |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
124 |
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. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
125 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
126 |
Some of the available LaTeX classes are, article, proc, report, book, slides, letter. |
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
|
127 |
|
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 |
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
|
129 |
\documentclass[12pt,a4paper,oneside,draft]{report} |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
130 |
|
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
|
131 |
``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
|
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 |
``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
|
134 |
|
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
|
135 |
``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
|
136 |
|
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
|
137 |
``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
|
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 |
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
|
140 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
141 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
142 |
Top Matter |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
143 |
~~~~~~~~~~ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
144 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
145 |
The information about the document such as it's title, the date, the author(s) information etc, is collectively known as the 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
|
146 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
147 |
Let us add top matter to our document, now. |
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
|
148 |
:: |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
149 |
|
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
|
150 |
\title{LaTeX - A How-to} |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
151 |
\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
|
152 |
\date |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
153 |
|
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
|
154 |
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
|
155 |
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
|
156 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
157 |
To put a specific date, you can specify it as below |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
158 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
159 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
160 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
161 |
\date{June 1, 2010} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
162 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
163 |
These details do not appear in the document until we use the ``\maketitle`` command with the document environment to instruct LaTeX to place the top matter information into the document. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
164 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
165 |
Sectioning Commands |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
166 |
~~~~~~~~~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
167 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
168 |
Documents are often divided into parts, chapters, sections and subsections. LaTeX provides an intuitive mechanism to use them in your documents. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
169 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
170 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
171 |
| command | level | comments | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
172 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
173 |
| ``part`` | -1 | not in letters | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
174 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
175 |
| ``chapter`` | 0 | only books and reports | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
176 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
177 |
| ``section`` | 1 | not in letters | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
178 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
179 |
| ``subsection`` | 2 | not in letters | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
180 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
181 |
| ``subsubsection`` | 3 | not in letters | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
182 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
183 |
| ``paragraph`` | 4 | not in letters | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
184 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
185 |
| ``subparagraph`` | 5 | not in letters | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
186 |
+-------------------+-------+------------------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
187 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
188 |
LaTeX has seven levels of sectioning commands, as shown above. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
189 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
190 |
Text of a block or a section of the document need not be enclosed 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
|
191 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
192 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
193 |
\section[Short Title]{This is a very long title and the Short Title will appear in the Table of Contents.} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
194 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
195 |
The short title appears in the table of contents, if at all one is generated. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
196 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
197 |
Section Numbering |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
198 |
+++++++++++++++++ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
199 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
200 |
As you may have observed, numbering is done automatically in LaTeX. Parts are numbered using roman numerals; Chapters and sections are numbered using decimal numbers. When a table of contents is inserted into the document, all the numbered headings automatically appear in it. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
201 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
202 |
A sectioning command appended with an asterisk gives an unnumbered heading that is not included in the table of contents. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
203 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
204 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
205 |
\section*{Introduction} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
206 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
207 |
By default, levels up to 2, are numbered, i.e, parts, chapters, sections and subsections. This can be changed by setting the ``secnumdepth`` counter using the ``\setcounter`` command. The following command removes numbering of the subsections. Only parts, chapters and sections will be numbered. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
208 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
209 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
210 |
\setcounter{secnumdepth}{1} |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
211 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
212 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
213 |
Appendices |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
214 |
~~~~~~~~~~ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
215 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
216 |
LaTeX allows for separate numbering for appendices. ``\appendix`` command indicates that the sections following it, are to be included in the appendix. |
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 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
219 |
\appendix |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
220 |
\chapter{First Appendix} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
221 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
222 |
Abstract |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
223 |
~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
224 |
LaTeX provides an ``abstract`` environment, to place an abstract in a document. The abstract appears in the document after the topmatter but before the main body of the document. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
225 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
226 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
227 |
\begin{abstract} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
228 |
The abstract abstract. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
229 |
\end{abstract} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
230 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
231 |
By default LaTeX uses the word "Abstract" as a title for the abstract. This can be changed using the ``\renewcommand``. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
232 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
233 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
234 |
\renewcommand{\abstractname}{Summary} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
235 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
236 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
237 |
|
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
238 |
Table of Contents |
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 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
241 |
Parts, chapters or sections that have been auto numbered by LaTeX automatically appear in the Table of Contents (ToC). ``\tableofcontents`` command places the ToC at the location, where the command has been issued. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
242 |
|
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
|
243 |
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
|
244 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
245 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
246 |
\setcounter{tocdepth}{3} |
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 |
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
|
249 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
250 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
251 |
\section*{Preface} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
252 |
\addcontentsline{toc}{section}{Preface} |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
253 |
|
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
|
254 |
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
|
255 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
256 |
Typesetting Text |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
257 |
---------------- |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
258 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
259 |
Text formatting |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
260 |
~~~~~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
261 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
262 |
Font Styles and Size |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
263 |
++++++++++++++++++++ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
264 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
265 |
LaTeX has three font families: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
266 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
267 |
1. roman ``\textrm{your text here}`` |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
268 |
2. serif ``\textsf{your text here}`` |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
269 |
3. monospace ``\texttt{your text here}`` |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
270 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
271 |
For emphasizing text, *italics* are generally used. The ``\emph`` command is used to emphasize text. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
272 |
``\textbf`` gives **bold face** text. Underlines can be made using the ``\uline`` command and ``\sout`` strikes out text. For small caps, ``\textsc`` command is to be used. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
273 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
274 |
LaTeX provides a series of commands to change the size of text. The table below shows the commands and the size of text, they produce. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
275 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
276 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
277 |
| size | 10pt (default) | 11pt option | 12pt option | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
278 |
+===================+================+=============+=============+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
279 |
| ``\tiny`` | 5pt | 6pt | 6pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
280 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
281 |
| ``\scriptsize`` | 7pt | 8pt | 8pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
282 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
283 |
| ``\footnotesize`` | 8pt | 9pt | 10pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
284 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
285 |
| ``\small`` | 9pt | 10pt | 11pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
286 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
287 |
| ``\normalsize`` | 10pt | 11pt | 12pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
288 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
289 |
| ``\large`` | 12pt | 12pt | 14pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
290 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
291 |
| ``\Large`` | 14pt | 14pt | 17pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
292 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
293 |
| ``\LARGE`` | 17pt | 17pt | 20pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
294 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
295 |
| ``\huge`` | 20pt | 20pt | 25pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
296 |
+-------------------+----------------+-------------+-------------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
297 |
| ``\Huge`` | 25pt | 25pt | 25pt | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
298 |
+-------------------+----------------+-------------+-------------+ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
299 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
300 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
301 |
Superscript and Subscript |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
302 |
+++++++++++++++++++++++++ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
303 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
304 |
For superscripting text in the text mode, LaTeX provides the ``\textsuperscript`` command. |
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
|
305 |
:: |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
306 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
307 |
This is how you super\textsuperscript{script} text. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
308 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
309 |
LaTeX does not provide any command for subscripting text in the text mode. The math mode needs to be used to obtain subscripts. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
310 |
|
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
|
311 |
:: |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
312 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
313 |
This is sub_{script} |
30
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 |
Quotation Marks |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
316 |
+++++++++++++++ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
317 |
|
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
|
318 |
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
|
319 |
:: |
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 |
`` Here is an example of putting `text' in quotes '' |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
322 |
|
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
|
323 |
Dashes and Hyphens |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
324 |
++++++++++++++++++ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
325 |
|
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
|
326 |
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
|
327 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
328 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
329 |
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
|
330 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
331 |
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
|
332 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
333 |
Lists - Itemize, Enumerate, and Description |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
334 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
335 |
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
|
336 |
|
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
337 |
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
|
338 |
|
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 |
:: |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
340 |
|
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
|
341 |
\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
|
342 |
\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
|
343 |
\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
|
344 |
\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
|
345 |
\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
|
346 |
\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
|
347 |
|
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 |
\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
|
349 |
\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
|
350 |
\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
|
351 |
\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
|
352 |
\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
|
353 |
\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
|
354 |
\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
|
355 |
\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
|
356 |
\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
|
357 |
\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
|
358 |
\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
|
359 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
360 |
Special Paragraphs |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
361 |
~~~~~~~~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
362 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
363 |
Footnotes |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
364 |
+++++++++ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
365 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
366 |
With the command:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
367 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
368 |
\footnote{footnote text} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
369 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
370 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
371 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
372 |
Quotes |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
373 |
++++++ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
374 |
|
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
|
375 |
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
|
376 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
377 |
|
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
|
378 |
The Zen of Python |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
379 |
\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
|
380 |
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
|
381 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
382 |
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
|
383 |
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
|
384 |
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
|
385 |
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
|
386 |
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
|
387 |
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
|
388 |
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
|
389 |
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
|
390 |
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
|
391 |
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
|
392 |
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
|
393 |
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
|
394 |
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
|
395 |
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
|
396 |
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
|
397 |
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
|
398 |
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
|
399 |
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
|
400 |
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
|
401 |
\end{quote} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
402 |
|
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
|
403 |
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
|
404 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
405 |
Verbatim |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
406 |
++++++++ |
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
|
407 |
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
|
408 |
:: |
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 |
\begin{verbatim} |
36
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
411 |
from numpy import * |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
412 |
a = linspace(0, 5, 50, endpoint = False) |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
413 |
\end{verbatim} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
414 |
|
36
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
415 |
from numpy import * |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
416 |
a = linspace(0, 5, 50, endpoint = False) |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
417 |
|
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
418 |
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
|
419 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
420 |
|
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
421 |
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
|
422 |
|
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
423 |
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
|
424 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
425 |
Including Code |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
426 |
++++++++++++++ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
427 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
428 |
The ``listings`` package can be used to embed source code into your LaTeX document. We shall briefly explore inserting python code into our document. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
429 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
430 |
Obviously, you first need to tell LaTeX that you want it to use the ``listings`` package, using the ``\usepackage`` command. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
431 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
432 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
433 |
\usepackage{listings} |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
434 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
435 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
436 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
437 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
438 |
\lstset{language=Python, |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
439 |
showstringspaces=false, |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
440 |
} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
441 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
442 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
443 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
444 |
You include a block of code into your document by enclosing it within the ``lstlisting`` environment. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
445 |
:: |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
446 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
447 |
\begin{lstlisting} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
448 |
string="Hello, World! " |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
449 |
for i in range(10): |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
450 |
print string*i |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
451 |
\end{lstlisting} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
452 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
453 |
You can also include source code files directly into your latex document, using the ``lstinputlisting`` command. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
454 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
455 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
456 |
\lstinputlisting[lastline=20]{lstexample.py} |
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
|
457 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
458 |
This command includes the first 20 lines of the file ``lstexample.py`` into out LaTeX document. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
459 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
460 |
Tables, Figures, Floats, & Referencing |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
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 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
463 |
Tables |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
464 |
~~~~~~ |
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
|
465 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
466 |
The ``tabular`` environment allows typesetting tables in LaTeX. Like any other environment it starts with ``\begin`` command and ends with ``\end``. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
467 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
468 |
It takes an optional argument, ``pos`` that specifies the vertical position of the table relative to the baseline of the surroundging text. It takes values of ``t`` for top, ``b`` for bottom, or ``c`` for center. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
469 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
470 |
The ``col fmt`` argument specifies the formatting of the columns of the table. Following are the possible arguments to the tabular environment. |
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
471 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
472 |
+---------------+------------------------------------+ |
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
473 |
| ``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
|
474 |
+---------------+------------------------------------+ |
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 |
| ``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
|
476 |
+---------------+------------------------------------+ |
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
477 |
| ``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
|
478 |
+---------------+------------------------------------+ |
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 |
| ``*{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
|
480 |
| | ``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
|
481 |
| | ``*{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
|
482 |
+---------------+------------------------------------+ |
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
483 |
| ``|`` | 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
|
484 |
+---------------+------------------------------------+ |
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 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
486 |
Each row in a table is separated by ``\\`` command and each column entry of a row is separated by ``&``. |
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 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
488 |
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
|
489 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
490 |
|
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
|
491 |
\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
|
492 |
\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
|
493 |
\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
|
494 |
\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
|
495 |
\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
|
496 |
\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
|
497 |
\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
|
498 |
\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
|
499 |
\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
|
500 |
& \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
|
501 |
\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
|
502 |
&\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
|
503 |
\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
|
504 |
\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
|
505 |
\hline |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
506 |
\end{tabular} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
507 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
508 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
509 |
Figures |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
510 |
~~~~~~~ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
511 |
|
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
|
512 |
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
|
513 |
:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
514 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
515 |
\usepackage{graphicx} |
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 |
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
|
518 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
519 |
:: |
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 |
\includegraphics[optional arguments]{imagename} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
522 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
523 |
A few ``optional arguments``: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
524 |
|
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
|
525 |
``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
|
526 |
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
|
527 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
528 |
``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
|
529 |
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
|
530 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
531 |
``scale=x`` |
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
532 |
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
|
533 |
|
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
534 |
``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
|
535 |
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
|
536 |
|
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
|
537 |
:: |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
538 |
|
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
|
539 |
\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
|
540 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
541 |
Floats |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
542 |
~~~~~~ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
543 |
|
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
|
544 |
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
|
545 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
546 |
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 figures, respectively. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
547 |
|
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
|
548 |
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
|
549 |
:: |
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 |
\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
|
552 |
\begin{table}[pos] |
30
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 |
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
|
555 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
556 |
+-----------+-------------------------------------------------------------------+ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
557 |
| Specifier | Permission | |
36
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
558 |
+===========+===================================================================+ |
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
|
559 |
| 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
|
560 |
+-----------+-------------------------------------------------------------------+ |
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
|
561 |
| t | at the top of the page. | |
30
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 |
| b | at the bottom of the page. | |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
564 |
+-----------+-------------------------------------------------------------------+ |
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
|
565 |
| p | on a special page for floats only. | |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
566 |
+-----------+-------------------------------------------------------------------+ |
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
|
567 |
| ! | Override LaTeX's internal parameters for good positions | |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
568 |
+-----------+-------------------------------------------------------------------+ |
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
|
569 |
| H | nearly equivalent to h! | |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
570 |
+-----------+-------------------------------------------------------------------+ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
571 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
572 |
Examples:: |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
573 |
|
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
|
574 |
\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
|
575 |
\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
|
576 |
\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
|
577 |
\end{figure} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
578 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
579 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
580 |
Captions |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
581 |
++++++++ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
582 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
583 |
The ``\caption{text}`` command allows you to add captions to floats. Similar to section numbering, LaTeX automatically numbers floats too. 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
|
584 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
585 |
:: |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
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 |
\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
|
588 |
\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
|
589 |
\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
|
590 |
\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
|
591 |
\end{figure} |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
592 |
|
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
|
593 |
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
|
594 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
595 |
List of Figures, Tables |
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
596 |
+++++++++++++++++++++++ |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
597 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
598 |
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. They can be added to the document using the ``\listoftables`` or ``\listoffigures`` commands. |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
599 |
|
56
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
600 |
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
|
601 |
|
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
|
602 |
Cross References |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
603 |
~~~~~~~~~~~~~~~~ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
604 |
|
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
|
605 |
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
|
606 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
607 |
The command ``\label{name}`` is used to label figures, tables or blocks of text, like chapters, sections etc. ``\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
|
608 |
|
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
|
609 |
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
|
610 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
611 |
Typesetting Math |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
612 |
---------------- |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
613 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
614 |
In general, it is advised to use the AMS-LaTeX bundle to typeset mathematics in LaTeX. AMS-LaTeX is a collection of packages and classes for mathematical typesetting. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
615 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
616 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
617 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
618 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
619 |
Styles or Modes |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
620 |
~~~~~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
621 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
622 |
LaTeX has two styles of inserting mathematical equations. They can either be inserted in-line within a paragraph (*text style*), or the paragraph can be broken to typeset them separately (*display style*). |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
623 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
624 |
Inline formulas are typeset by placing them in two ``$`` symbols or in between ``\(`` and ``\)``. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
625 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
626 |
Displayed equations or equations that are set apart from the paragraph text are typeset by using ``\[`` and ``\]`` or ``\begin{equation*}`` and ``\end{equation*}`` for unnumbered equations or ``\begin{equation}`` and ``\end{equation}`` for numbered equations. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
627 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
628 |
LaTeX provides several environments for handling equation groups and multi-line equations. ``multiline``, ``gather`` and ``align`` are a few. We shall look at ``align`` environment here. You could try out the others, in the lab. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
629 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
630 |
``align`` numbers each of the lines in the environment, and ``align*`` as expected, does not number any of them. 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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
631 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
632 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
633 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
634 |
\begin{align} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
635 |
a^2 + b^2 &= c^2 \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
636 |
a + b &> c \nonumber\\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
637 |
b + c &> a \nonumber\\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
638 |
c + a &> b \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
639 |
\end{align} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
640 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
641 |
Basic Elements |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
642 |
~~~~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
643 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
644 |
Greek Letters can are entered as ``\alpha, \beta, \gamma, \delta, ...`` for lowercase letters and ``\Alpha, \Beta, \Gamma, ...`` for uppercase ones. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
645 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
646 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
647 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
648 |
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]``. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
649 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
650 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
651 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
652 |
A fraction can be typeset with the command ``\frac{..}{..}`` |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
653 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
654 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
655 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
656 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
657 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
658 |
Arrays and Matrices |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
659 |
~~~~~~~~~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
660 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
661 |
To typeset arrays, use the ``array`` environment. It works similar to the ``tabular`` environment. The ``\\`` command is used to break the lines. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
662 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
663 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
664 |
\begin{equation*} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
665 |
\mathbf{X} = \left( |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
666 |
\begin{array}{ccc} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
667 |
a_1 & a_2 & \ldots \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
668 |
b_1 & b_2 & \ldots \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
669 |
\vdots & \vdots & \ddots |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
670 |
\end{array} \right) |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
671 |
\end{equation*} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
672 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
673 |
The ``array`` environment can also be used to typeset piecewise functions by using a “.” as an invisible ``\right`` delimiter |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
674 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
675 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
676 |
\begin{equation*} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
677 |
f(x) = \left\{ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
678 |
\begin{array}{rl} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
679 |
0 & \text{if } x \le 0\\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
680 |
1 & \text{if } x > 0 |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
681 |
\end{array} \right. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
682 |
\end{equation*} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
683 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
684 |
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. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
685 |
:: |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
686 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
687 |
\begin{equation*} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
688 |
\begin{matrix} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
689 |
1 & 2 \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
690 |
3 & 4 |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
691 |
\end{matrix} \qquad |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
692 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
693 |
\begin{bmatrix} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
694 |
1 & 2 & 3 \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
695 |
4 & 5 & 6 \\ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
696 |
7 & 8 & 9 |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
697 |
\end{bmatrix} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
698 |
\end{equation*} |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
699 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
700 |
Spacing |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
701 |
~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
702 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
703 |
| Abbrev. | Spelled out | Example | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
704 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
705 |
| | no space | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
706 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
707 |
| \, | \thinspace | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
708 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
709 |
| \: | \medspace | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
710 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
711 |
| \; | \thickspace | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
712 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
713 |
| | \quad | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
714 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
715 |
| | \qquad | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
716 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
717 |
| \! | \negthinspace | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
718 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
719 |
| | \negmedspace | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
720 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
721 |
| | \negthickspace | | |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
722 |
+---------+----------------+---------+ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
723 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
724 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
725 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
726 |
Referencing |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
727 |
~~~~~~~~~~~ |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
728 |
Equations can also be cross referenced using the ``\label`` and ``\eqref`` commands. |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
729 |
|
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
730 |
|
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
731 |
Bibliography |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
732 |
------------ |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
733 |
|
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
|
734 |
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
|
735 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
736 |
``thebibliography`` environment |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
737 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
738 |
|
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
|
739 |
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
|
740 |
|
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 |
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
|
742 |
:: |
36
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
743 |
|
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
|
744 |
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
|
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 |
\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
|
747 |
\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
|
748 |
|
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
|
749 |
\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
|
750 |
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
|
751 |
\end{thebibliography} |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
752 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
753 |
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
|
754 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
755 |
BibTeX |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
756 |
~~~~~~ |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
757 |
|
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
|
758 |
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
|
759 |
|
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
|
760 |
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
|
761 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
762 |
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
|
763 |
:: |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
764 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
765 |
@book{Lamport94, |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
766 |
author = "Leslie Lamport", |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
767 |
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
|
768 |
publisher = "Addison-Wesley Professional", |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
769 |
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
|
770 |
edition = "second", |
36
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
771 |
note = "illustrations by Duane Bibby" |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
772 |
} |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
773 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
774 |
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
|
775 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
776 |
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
|
777 |
|
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
778 |
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
|
779 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
780 |
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
|
781 |
:: |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
782 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
783 |
\bibliographystyle{plain} |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
784 |
\bibliography{LaTeX} |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
785 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
786 |
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
|
787 |
|
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
788 |
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
|
789 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
790 |
Compiling |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
791 |
+++++++++ |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
792 |
|
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
|
793 |
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
|
794 |
|
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
795 |
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
|
796 |
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
|
797 |
3. Compile the ``.tex`` file again. |
4c4c8a9795b2
Edited Arrays & Matrices and Bibliography sections.
Puneeth Chaganti <puneeth@fossee.in>
parents:
30
diff
changeset
|
798 |
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
|
799 |
|
101
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
800 |
Beamer |
e529bec52b6f
Revised latex handout for new sees course; will drop this and make it more need based.
Puneeth Chaganti <punchagan@gmail.com>
parents:
63
diff
changeset
|
801 |
~~~~~~ |
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
|
802 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
803 |
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
|
804 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
805 |
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
|
806 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
807 |
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
|
808 |
|
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 |
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
|
810 |
|
eee394eb05fc
Added Loops section in ULT, modified LaTeX handout to use examples from sample doc.
Puneeth Chaganti <puneeth@fossee.in>
parents:
36
diff
changeset
|
811 |
``\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
|
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 |
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
|
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 |
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
|
816 |
|
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
817 |
|
61
cfae54ede139
minor edits to LaTeX handout and session 4.
Puneeth Chaganti <puneeth@fossee.in>
parents:
56
diff
changeset
|
818 |
Recommended Reading |
63
dc13f22e9489
Minor changes in ULT-sessions 4,5 and LaTeX handout for Sphinx build.
Puneeth Chaganti <puneeth@fossee.in>
parents:
61
diff
changeset
|
819 |
------------------- |
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
820 |
|
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
821 |
1. *LaTeX Wikibook* |
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
822 |
|
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
|
823 |
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
|
824 |
|
30
3ca8ab883c13
First Draft of LaTeX handout added.
Puneeth Chaganti <puneeth@fossee.in>
parents:
diff
changeset
|
825 |