0% found this document useful (0 votes)
65 views

LATEX For Absolute Beginners

This tutorial will show you how to do some basic typesetting of math symbols, equations and matrices.

Uploaded by

mkumar_324365
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

LATEX For Absolute Beginners

This tutorial will show you how to do some basic typesetting of math symbols, equations and matrices.

Uploaded by

mkumar_324365
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

L

A
T
E
X for Absolute Beginners Math Typesetting I
Math I: Super/Subscripts and
Common Commands
Introduction
This tutorial will show you how to do some basic typesetting of math symbols,
equations and matrices. Although L
A
T
E
X in its basic form (i.e. when you start
to write it in WinEdt) can do almost everything in math that the normal user
will want to do, we can make it more user-friendly by telling it to load certain
packages into its operating memory.
open WinEdt and write the following:
\documentclass{article}
\usepackage{amsmath, amssymb}
\begin{document}
\end{document}
Note that this is just like last time, except that we have added
\usepackage{amsmath, amssymb}
in our preamble. These packages gives L
A
T
E
X access to some more symbols
and some more structures that we will nd useful and will make our lives a
bit easier today. You dont have to load them every-time you want to write
math, but some of our commands and symbols today (or in the second
math typesetting session)specically those connected to matriceswill
work only if you do. Note that amsmath and amssymb are dierent packages
that need to be separated by a comma.
Reminder: In Line and Display
when you want some math in the same line as your text, you use the
dollar signs. So, $4x-6y=67$ will produce the expression in the text, as
4x 6y = 67. Here is another sentence to convince you it was genuinely
in text.
when you want some math displayed on its own below your text, you use
\[ \]. So, \[x+37=56\] gives
x + 37 = 56.
everything I say below about writing math in dollar signs will apply to the
math display mode, \[ \], too. Sometimes it will look slightly dierent,
1
L
A
T
E
X for Absolute Beginners Math Typesetting I
because L
A
T
E
X adjusts heights of characters and their spacing to look more
reasonable given it is in text. For example,

n
i=1
f(x) looks dierent to
n

i=1
f(x),
but they were produced using the same commands (but in-line and dis-
played, respectively)
note that numbers like 1, 2, 67, 3459 are always in math mode. There
seems to be a UK/US dierence when writing large numbers with commas.
Americans often dont leave a space between the comma and the next
number, but many other nationalities do. So, Brits write $100,000$ to
write 100, 000, whereas Americans write 100,000 (without the $ $ signs)
to write 100,000.
note that letters in math mode look very dierent compared to those in
text. So $x$ gives x, while in text, we would have x
Be careful with punctuation in math mode. Suppose you wanted to write
y
x
=
1
|x|
,
then you need to be sure that you put the comma (or semi-colon, or
whatever) in the right place. This displayed formula was produced with
the following code:
\[\frac{\partial y}{\partial x}=\frac{1}{|x|},\]
Note that the comma that comes at the end of the formula occurs before
the command \]. If we put the comma after the \] command it would
appear on the next line (incorrectly). That said, when we write in line
math recall with dollar signs make sure you put the comma after the
closing dollar sign.
Greek Letters
In math mode, you sometimes need Greek letters, like , , and so on.
generally, the command structure is $\letter-name$. So, to get a theta
you type $\theta$. That gives you .
note that I used a lower-case t at the start of theta to get a lower case
theta in math mode. To get an upper case one, you use a capital T. So,
$\Theta$ gives
2
L
A
T
E
X for Absolute Beginners Math Typesetting I
this upper/lower case distinction is not the case for all Greek letters: for
example, there is only one type of alpha and beta L
A
T
E
X will produce (and
they both take the lower case): $\alpha$ gives you and $\beta$ gives
you , whilst $\Beta$ will give you an undened command message
if you cant remember all the names of the letters, WinEdt can help you
out. Look at the top of your tool bar, and you will see a sum button

(this is actually a capital epsilon, but is produced using $\sum$. To the
left of it is a picture of a video camera and to the right is an umlauted E.
Pressing the

button gives you all the math and Greek characters you
will need (and a lot of other useful symbols beside). Pick one, and press
its button. Notice that it just writes the command for that symbol: you
need to put it in dollar signs otherwise L
A
T
E
X wont understand what you
want to do.
when you write a greek letter command (or any other math command),
you must leave a space between the end of the command and the next
nonoperationlike +, , , character. So, it wont know what to do
with $\alpha5$, but if you give it $\alpha 5$ it will write 5 (note how
it deletes the space you left between the characters).
Subscripts and Superscripts
to subscript an expression, like P
i
you use an underscore in the following
way: $P_i$. If there an expression of several symbols that are to be
a subscript, you need to use braces. If you dont use an opening brace
after the underscore, only the rst character will be subscripted. So,
$R_i\beta$ gives you R
i
, but $R_{i\beta}$ gives you R
i
.
to superscript an expression, like F
x
you use the hat symbol in the fol-
lowing way: $F^x$. If there an expression of several symbols that are
to be a superscript, you need to use braces. If you dont use an opening
brace after the hat, only the rst character will be superscripted. So,
$G^2\alpha$ gives you G
2
, but $G^{2\alpha}$ gives you G
2
.
sometimes symbols have a subscript and a superscript. Here is a John
Duggan favorite: x
m
i
which was produced by writing $x_i^m$: you could
also use $x^m_i$ since L
A
T
E
X understands either order of superscripts and
subscripts. What was said about braces (above) still applies.
subscripts and superscripts can themselves have subscripts and super-
scripts. To get e
k
i
, you use $e^{k_i}$. Note that the i used for the
subscript of the k is smaller than the e and the k.
for things like integrations and sums, we use exactly the same principles.
To show integration between x and for example, we type $\int^\infty_x$
3
L
A
T
E
X for Absolute Beginners Math Typesetting I
which yields
_

x
, or
_

x
in display mode.
Summing between i = 1 and n over x
i
is written as $\sum^{n}_{1} x_i$
which yields

n
i=1
x
i
, or
n

i=1
x
i
in display mode.
Inequalites, equalities, set notation etc.
L
A
T
E
X has lots of symbols available for use. You can nd many of these if you
press the

key on the tool-bar as we discussed above. We will not list all the
possible symbols (you can nd them in any L
A
T
E
X guide book), but some of the
common ones are in the table below (once again, all of this must be in the math
mode). Some of the are commands are intuitive, some arent. You (may) need
to use the packages we specied above to have access to of all of them.
Notice that some of them allow you to write subscripts/superscripts and
limits in the way we discussed before. For example, you could write
\[\bigcap^\infty_{i=1}(i-1,i)=\emptyset\]
if the mood so took you. This gives:

i=1
(i 1, i) = .
(If that is correct, credit to me. If it is wrong, blame Tugba G uvenc. She never
did give us solution sets. . . )
4
L
A
T
E
X for Absolute Beginners Math Typesetting I
output input output input
= = = \ne
< < > >
\leq \geq
\in \ni
/ \notin \forall
\exists \nexists
\emptyset R \mathbb{R}
\prime \blacksquare
\partial \div
\cup \cap

\bigcup

\bigcap
\subset \supset
\subseteq \supseteq
\Leftrightarrow \Longleftrightarrow
\Leftarrow \Rightarrow
\times \approx
x|y x|y \therefore
\infty

\prod
\vee \land
Words: lim, det, sin. . .
In math you often use small words like cos to mean cosine, max to mean maxi-
mum and so on. If you just write the words in math mode, it wont look correct.
For example, if we write $sin\theta$ we get sin, which is not what we want.
If we write $\sin\theta$, though, it reads as: sin. The commands for these
operators are generally intuitive, and we give a brief list of some common ones
here.
output input output input
det \det inf \inf
lim \lim liminf \liminf
limsup \limsup sup \sup
max \max min \min
Pr \Pr arg \arg
cos \cos exp \exp
sin \sin cos \cos
tan \tan deg \deg
lim

\varinjlim lim

\varprojlim
5
L
A
T
E
X for Absolute Beginners Math Typesetting I
Brackets
Examples include parentheses like (a, b) which was produced using (a,b) or
curly braces like {a, b} produced using \{a,b\}.
if you type the commands above, they give you only a certain (regulated)
size of delimiter. But that doesnt look correct in some circumstances.
For example:
(
n

i=1
),
produced by \[(\sum_{i=1}^n)\] looks strange. You can correct for this
by using variable size delimiters which have the general format:
\leftopen delimiter math bit \rightclose delimiter.
So, the following code \[\left(\sum_{i=1}^n\right),\] gives you
_
n

i=1
_
.
You could substitute ( and ) with [ and ] or { and } or \langle and
\rangle as desired.
Accents
Suppose you want

h: you will use $\hat{h}$. Notice that you have to be in
math mode for this to work. For example, \hat{h} without the dollar signs
wont be understood by L
A
T
E
X . Here is a useful list for guidance (from Diller,
p102):
output input output input
a \acute{a}

f \dot{f}

b \bar{b} ` g \grave{g}
c \breve{c}

h \hat{h}

d \check{d} \tilde{\imath}
e \ddot{e} \vec{jmath}
If you want to put any of the accents over more than a single symbol L
A
T
E
X
will just center the accent over the whole expression. However, for the \hat and
\tilde command there are wide versions: so, $\widehat{npq}$ gives npq,
and $\widetilde{mvp}$ gives mvp.
6

You might also like