1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
.. Objectives
.. ----------
.. At the end of this tutorial, you will be able to
.. 1. Write simple mathematical formulae in LaTeX.
.. #. Typeset simple mathematical formulae in LaTeX.
.. #. Write bibliography for a LaTeX document.
.. #. Make presentations in LaTeX, using beamer.
.. Prerequisites
.. -------------
.. 1. Introduction to LaTeX.
.. #. Basics of LaTeX and its document structure.
.. #. Typesetting LaTeX text.
.. 1. latex_intro
.. Author : Harish Badrinath < harish [at] fossee [dot] in >
Internal Reviewer :
External Reviewer :
Langauge Reviewer :
Checklist OK? : <put date stamp here, if OK>
Script
------
.. L1
{{{ Show the first slide containing title, name of the production
team along with the logo of MHRD }}}
.. R1
Hello friends and welcome to the tutorial on basics of typesetting mathematical
formulae, bibliography and presentations, using LaTeX.
.. L2
{{{ Show the objectives slide }}}
.. R2
.. At the end of this tutorial, you will be able to
.. 1. Write simple mathematical formulae in LaTeX.
.. #. Typeset simple mathematical formulae in LaTeX.
.. #. Write bibliography for a LaTeX document.
.. #. Make presentations in LaTeX, using beamer.
.. L3
{{{ Switch to the pre-requisite slide }}}
.. R3
Before beginning this tutorial, it is recommended to complete the tutorials
given in the prerequisite.
.. L4
.. R4
In general, it is advisable to use the AMS-LaTeX bundle to typeset mathematics
in LaTeX. AMS-LaTeX is a collection of packages and classes for mathematical
typesetting.
We can load amsmath by issuing the \usepackage{amsmath} in the preamble.It must
be noted that amsmath is included in the base distribution of LaTex, in atleast
the most recent versions.
Math formulae can be embedded in two ways,
“inline” or “text style ” method, which is done by enclosing the
required command and text within two dollar signs or between an backslash
opening bracket and backslash closing bracket.
By enclosing them in a dedicated environment respectively/displayed style.
The most common LaTeX environment used to typeset mathematical formulae is
from equation family.
.. L5
.. R5
An environment like bmatrix for example, is used to render a matrix. The syntax
for specifying a matrix is similar to that used in the tabular environment. The
& symbol is used for demarcating columns and \\ is used to demarcate rows.
There are 5 other matrix environments and each have different/no type of
delimiters. A table showing the data is being shown on the screen. The matrix
and its allied environments are defined by the amsmath package.
.. L6
.. R6
The screen shows the an example, that renders different types of matrices using
LaTeX.
It also shows the two ways in which mathmatical formulae can be embedded into
LaTeX documents.
Please pause the tutorial and go through the example shown on the screen.
.. L7
{{{continue from paused state}}}
.. R7
To typeset superscripts in LaTeX, the carat character is used. The carat
operator just acts on the next character.
To typeset subscripts in LaTeX, the underscore character is used. The carat
operator just acts on the next character.
Multiple characters and ambiguity is resolved by grouping them using opening
and closing curly brackets.
.. L8
.. R8
To typeset the summation symbol, use the sum command. Similarly, the integral
symbol is obtained using the int command. The upper and lower limits, for both
the sum and int command are specified using the carat and underscore characters
, respectively.
.. L9
.. R9
We now move onto using the equation environment to render mathematical formulae,
which are numbered. Another environment called equation star environment renders
unnumbered equations.
Backslash and opening square bracket and its counterpart the backslash
closing square bracket is a short hand for equation star environment.
There is no similar shorthand for equation environment (i.e, the numbered
equation environment).
.. L10
.. R10
The equation and its allied environments allows only one equation at a time.
We cannot use the newline command in the equation and its allied environment.
To come around this requirement, we can use eqnarray environment to group
multiple equations.
The eqnarray environment provides additional convenience like auto alignment
using the ampersand command, auto numbering of equations, etc.
Each distinct equation in the group needs to be separated by a newline command.
The parts of the equation that need to be aligned are indicated using an
ampersand symbol.
.. L11
.. R11
To typeset fractions use the frac command. To typeset surds, we use the sqrt
command with the optional paramter of [n].
Please note that there is a special command dfrac, that can be used to render
fractions as if its placed in display mode and is meant to be used even in
inline mode.
.. L12
.. R12
Inserting Greek letters into LaTeX is simple. we use commands named alpha, beta,
gamma, etc for lower case Greek letters. Similarly, we use Alpha, with an upper
case A, Beta, with an upper case B, Gamma, with an upper case G, etc for upper
case greek letters.
Also, math environments do not give extra spaces using the space or tab
characters. The following commands show in the table on the screen are available
to specify the spacing required.
.. L13
.. R13
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.
Each entry of the bibliography begins with the command bibitem. It takes an
optional parameter called label and a name for the entry.The label option
replaces the numbers from the auto enumeration with the labels given.
The to cite the bibliography item within the document, we use the cite command,
containing name as a parameter.
We start the bibliography environment with a numerical parameter. This defines
how much space is to be reserved for all the labels.
If for example, we have less than 10 items in the Bibliography we would begin
the bibliography environment with an parameter, whose value is 9.
.. L14
{{{continue from paused state}}}
.. R14
It is highly recommended to use beamer to create presentations, especially when
you are using LaTeX typesetting your report. This is mainly because, it would be
really easy to reuse the LaTeX that you have used for the report/document for
the presentation as well.
We begin a beamer document with the documentclass being set to beamer.
A beamer document is very similar to other LaTeX documents, with the exception
that content is divided into slides.
.. L15
.. R15
The usetheme command is used to specify the theme to be used for the current
presentation. The usecolor theme command is used to specify the color theme to
be used in the current presentation.
The contents of a slide are enclosed within the begin frame and end frame
environment. The begin command with frame as the parameter can optionally be
passed the Title and Subtitle of the slide it contains.
We must also note that the title page of the presentation can be set like any
other LaTeX document.
If we have to use fragile environemts like verbatim or lstlisting inside a
slide, then we have to pass an additional parameter to begin frame, fragile.
Overlays and simple animation can be achieved using the pause command.
We recommend you look at the beamer user guide, to get more acquainted with
this marvelous utility.
.. L16
.. R16
This screen shows a very basic LaTeX presentation done using beamer. We use the
warsaw theme. There are three slides in the actual document definition, but we
see more than 3 slides in the output document. This is because of the overlay
we created in the last slide. Please pause the tutorial and go through the
example shown on the screen.
.. L17
{{{continue from paused state}}}
{{{ Show summary slide }}}
.. R17
This brings us to the end of this tutorial. In this tutorial, we have,
.. 1. Written simple mathematical formulae in LaTeX.
.. #. Typeset simple mathematical formulae in LaTeX.
.. #. Written bibliography for a LaTeX document.
.. #. Made a sample presentations in LaTeX, using beamer.
.. L18
{{{Show self assessment questions slide}}}
.. R18
Here are some self assessment questions for you to solve
1. What is the function of useoutertheme command used in the beamer
presentation example shown before ?? what happens when you comment out or
remove the line.
2. Are commands like \alpha, \beta ,etc commands provided by amsmath package ?
.. L19
{{{Show self assessment questions slide}}}
.. R19
And the answers,
1. The outertheme command in beamer is used to customize the amount of
header/footer information shown in each slide. In the example shown below the
useoutertheme command with infolines argument automatically adds more
information to the footer like page number, author and institute,etc.
2. No, commands like alpha, beta, etc are not commands provided by the amsmath
package.
.. L20
{{{ Show the thankyou slide }}}
.. R20
Hope you have enjoyed this tutorial and found it useful.
Thank you!
|