0% found this document useful (0 votes)
32 views15 pages

Introduction to LaTeX Basics

Uploaded by

yashitaa276
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views15 pages

Introduction to LaTeX Basics

Uploaded by

yashitaa276
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1 Introduction

1.1 Introduction to La Tex


LaTeX is a family of programs designed to produce publication-quality typeset
documents. It is particularly strong when working with mathematical symbols.
The history of LaTeX begins with a program called TEX. In 1978, a computer
scientist by the name of Donald Knuth grew frustrated with the mistakes that
his publishers made in typesetting his work. He decided to create a typesetting
program that everyone could easily use to typeset documents, particularly
those that include formulae, and made it freely available. The result is TEX.
Knuth's product is an immensely powerful program, but one that does focus
very much on small details. A mathematician and computer scientist by the
name of Leslie Larnport wrote a variant of TEX called LaTeX that focuses on
document structure rather than such details.

1.2 Required Components of a LaTeX Document


Every LaTeX document must contain the following three components.
Everything else is optional (even text).

l. \document class{article}

3. \end{document}

The first statement tells LaTeX what kind of document it is to process, as there
are different style rules for different kinds of documents. We will use the
article document class exclusively in this tutorial. Other possible classes
include report, book, and letter.
The default font size for each class is 10 point. You can use 11 point or 12
point fonts by including this information in the \documentclass command as \
documentclass [llpt) {article} or \documentclass [12pt] {article}. You could
also use \documentclass [IOpt] {article}, but since this is the default you don't
need to type the (10pt]' part,
In general, required information is included in LaTeX commands in braces o,
while optional information is included in square brackets l].
The \documentclass command must appear at the very beginning of your
LaTeX document, before any other LaTeX commands, or you will get an error
message.

Scanned with OKEN Scanner

Scanned with OKEN Scanner


If you have commands for LaTeX that will affect the whole document, you
should include them in the preamble, which is what the space between the \
documentclass and commands is called. The body of the
document, where you include all of your text, must occur between the \
begin{document} and commands. Any text that comes after
the command will be ignored,

1.3 Using LaTeX on Elon's Computers


LaTeX consists of several programs:

1. A program latex that processes your input.


2. A program (yap on our computers) that previews and prints your work.

In addition, you need an editor that produces plain text without formatting
commands as well as a good spell-checker.
Jim Beuerle has arranged for all of these programs to be installed on Elon's lab
PC's, as well as a program TeXShe11 to coordinate them.
You can start TeXShe11 either from a desktop seashell icon (for the machines
in Duke 201, 204, and 209) or from the Start/Coursevare/Math menu (for the
lab machines).
To use TexShe11, you need to follow the following steps:

1. You should either create a new LaTeX file with File/Nev or open an
existing LaTeX file with File/ Open.
2. You need to designate the main file that you will be working with, since
LaTeX files can include Other LaTeX files and the programs need to
know which one to use; a number of secondary files will be created with
the same filename but different extensions. Use File/Main File.
3. You should use the main editing screen to enter and revise your work.
4. Always spell-check or your teachers will laugh and/or cry at your work:
use Edit/Spe11 Check.

5. Press the Tex button to run the LaTeX program on your file. A small
window will open and close during this time; any error messages will
show up there: if successful the window will close itselE If not, you will
need to type a.n "x" and hit Enter to close it after reading the error
message.
6, If you want to see the warnings and error messages later, press the Log
button.

Scanned with OKEN Scanner

Scanned with OKEN Scanner


7, To view your masterpiece, press the Preview button. If you are happy
with the result, the Preview program has a printer icon at the top left.
8. If your masterpiece includes graphics, you will probably want to create a
PDF file for printing and sharing: use the PDFLaTeX button to create a
PDF file (with a file extension pdf). Use Acrobat Reader to preview and
print it; this program is installed on all Elon PC's and will start up if you
double click the file's name in any directory listing.

1.4 Error Messages


LaTeX will tell you when it figures out that something is wrong, Often the
actual error occurs earlier in your file.
A common error is not to close braces for a command. Another one that occurs
frequently is to use math commands outside of math mode (described later).
Since LaTeX will stop after any command: a good strategy for finding errors is
to insert temporarily earlier in the file to see if the error is above its location.

1.5 Typing LaTeX Commands


For this tutorial, you will occasionally find yourself having to type LaTeX
commands as part of your text. How do you do that without LaTeX taking
them seriously and following them?
Surround auy text that you want printed as is with a and an
command.
Practice: Create a document that explains what some LaTeX commands do.

c,

Scanned with OKEN Scanner

Scanned with OKEN Scanner


EX . NO
DATE :

MAKE A TABLE DATA IN LATEX

AIM •
To make a table data in LATEX
LATEX CODE

Ndocumentclass{article)

usepac kage {colo r}


Xend{center)

lc lc lc lc lc l)
Xhline

Xhline
1& & 123456789 & aaaaaa\\
\hline
2& & Ntextit{yyyy} & 987654321 & bbbbbb\\
\hline
3& & 567894321 & cccccc\\
\hline

Xend{document}
EX . NO
DATE :

MAKE A TABLE OF MATHEMATICAL SYMBOLS USING LATEX

ATM :
To make a table of mathematical symbols using latex

LATEX CODE
Ndocumentclass{articl
e) use pac kage
{tabula rx) use pac
kage {xcolo r}
\ begin {center} \begin {LARGE)
\ LaTex \medspace MATHEMATICAL SYMBOLS
Xend{LARGE) Nend{center)
\begin{center}
\begin{tabular}{ lc lc lc lc l}
Xhline

O. Scanned with OKEN Scanner


OF THE SYMBOL} &
\scriptsize{SYMBOL) &
\hline
1& & $\a1phaS & Xtextbac kslash alpha
\hline
2& & $\beta$ a \textbackslash beta
\hline
3& {Gamma} & $ Ngamma$ & Xtextbac kslash gamma \ \ \hline
4& {Delta} & $ Ndelta$ a \textbac kslash delta
\hline
5& & $\epsi10nS & Ntextbackslash
epsilon
\hline
6& & $\zeta$ & \textbackslash zeta
Xhline 7 & & $\eta$ a \textbackslash eta

\hline g & & $\theta$ & \textbackslash theta


\hline
9& & $\iota$ & \textbackslash iota
\hline
16 & & S\kappaS & Xtextbackslash
kappa \\
\hline 11 & {Lambda} & $\lambda$ & Xtextbac kslash lambda
\\
Xhline 12& & S\muS a \
textbackslash mu
\hline
13 & & $ Nnu$ a \textbackslash nu
\hline
14 & & $\pi$ & \textbac kslash pi \\
\hline
15 & & rho$ & \textbac kslash rho
\hline
16 & & $\sigma$ & Xtextbac kslash sigma \\
\hline 17 & & SNtau$ & \textbackslash
tau
Xhline
18 & & $\upsi10nS & \textbackslash
upsilon
\hline 19 & & $\phi$ & \textbackslash
phi
Xhline
20 & & S\chi$ & \textbac kslash chi
Xhline 21 & & SNpsi$ & \textbac
kslash psi
\hline 22 & & $\omega$ & Xtextbac kslash
omega

O. Scanned with OKEN Scanner


Xhline 23 & & $\xi$ & \textbackslash
xi \\
\hline
24 & a
S\varepsilon$ a \textbackslash varepsilon
\hline
25 & a $\
varphi$ & Xtextbackslash varphi
\hline
26 & & S\
varpiS & \textbackslash varpi \\
\hline
27 & R $\
varsigma$ \textbackslash varsigma
\hline
28 & & $\
varthetaS & \textbackslash
vartheta
Xhline 29 & & $\De1taS & Xtextbackslash
delta \\
\hline
30 & & SNGammaS & \textbac kslash Gamma \\
\hline
31 & & LambdaS & itextbackslash Lambda
\hline
32 & & SNOmegaS & \textbac kslash Omega \\
\hline
33 & & $\Phi$ & \textbac kslash Phi
\hline 34 & & SNPi$ a \textbackslash
Pi \\
Xhline 35 & & $\Psi$ & \textbackslash
Psi
\hline 36 & & $\Sigma$ & \textbac kslash
Sigma
Xhline 37 & & $\ThetaS & Xtextbackslash
Theta \\
\hline
& & $\Upsi10n$ & \textbackslash
Upsilon
Xhline
39 & & $\Xi$ & \textbackslash xi \\
'\hline
& & $\aleph$ & Xtextbac kslash aleph
\hline

lc lc lc lc l}
\hline
41 & & $ Nsw$ & \textbac kslash stm

O. Scanned with OKEN Scanner


\hline
42 & & $\prod$ & \textbac kslash prod
\hline
43 & & $\coprodS & Ntextbackslash cop
rod
\hline 44 & & $ Nint$ & \textbac kslash
int
Xhline 45 & & $\ointS & \textbackslash
oint
\hline 46 & & $\bigcap$ & Ntextbackslash
bigcap
Xhline
47 & & $\bigcupS & Xtextbackslash bigcup
bigoplus \ textbackslash propto

bigotimes \ textbackslash ne \\
Xhline
48 & & $\bigop1usS & \ textbackslash
bigodot
Xhline
49 & & $\
bigotimes$ & \textbackslash
bigwedge
\hline
50 & & $\bigodotS & Ntextbackslash
bigsqcup
\hline 51 & Xcolcr{red} {bigvee} & $\bigvee$ & Xtextbac
kslash bigvee Xhlzne
52 & & $\bigwedge$ & \textbackslash

\hline
53 & R $\bigsqcup$ \textbackslash
\hline
54 & & SNtan$ & \textbac kslash tan
\hline
55 & R $\cos$ & \textbac kslash cos
Xhline
56 & & S\csc$ & \textbac kslash csc
\hline
57 & & $ Nexp$ & \textbac kslash exp
Xhline
58 & & $\Omega$ & \textbac kslash
equiv \hline Omega \\
59 & & SNpsi$ & \textbac kslash psi
\ textbac kslash approx \hline
60 & & $\omega$ & \textbac kslash
\hline omega \\
cong \\
61 & & $\sin$ & \textbac kslash sin
\ textbackslash simeq
Xhline

O. Scanned with OKEN Scanner


62 &
\hline
63 & equalent to} & $\equiv$ & \textbackslash & $\tan$ & \
Xhline textbackslash tan
\ 64 & approximately) & S\approx$ &

\hline
65 & congruent) & S\cong$ & \textbackslash
\hline
66 & similar or equal to & $\simeq$ &

Xhline
67 & similar to ) & S\sim$ & \textbackslash sim
\hline
68 & proportional to} & $\propto$ &
\hline
69 & not equal) & S\neS & Ntextbackslash neq
\hline or
70 & equal to) & $$ &
Xhline
71 & parallel with) & $\para11e1S &
textbackslash parallel
\hline
72 & asymptotic to) & $\asymp$ &
\ textbackslash asymp
Xhline
73 & member of) & S\inS & itextbackslash in \\
Xhline 74 & & $\mode1sS &
Xtextbackslash models
\hline
75 & perpendicular with} & $\perpS &
\ textbackslash perp
\hline
76 & not member of) & S\notxn$ & \
csc \\ textbackslash
\hline 77 & & $\mid$ & Xtextbac kslash
mid
Xhlzne
78 & empty set) & $\emptyset$ &
\ textbackslash
emptyset
\hline
7g R AB)$ &
\ textbackslash
overline
\hline
86 & & S\ang1eS & Xtextbac kslash angle \\
\hline

O. Scanned with OKEN Scanner


lc lc lc lc l)
\hline
81 & & $\triang1eS & \
textbackslash t riangle
Xhline
82 & & $\cong$ & \
textbackslash cong
\hline
83 & (half-line & AB}$
&
\ textbackslash overrightarrow
\hline
84 & & $\arccosS & \textbackslash arccos
\hline
85 & derivative} & $\partial$ &
\ textbackslash partial
Xhline
86 & Planck 's constant) & S\hbarS &
\ textbackslash
hbar
\hline 87 & part) & $\Re$ & \ text bac
kslash Re
Xhline
88 & part) a S\lm$ \textbackslash 1m
\hline
\ textbackslash nabla
\hline
90 & & $\inftyS & \textbackslash infty
\hline
gl & parenthesis} & $ 1$ & $ l$
\hline
92 & (left & S\lceil$ a \textbackslash
Iceil
\hline
g3 &
(right & $\rceil$ & \textbac kslash
rceil
Xhline
94 & & S\lfloor$ \textbackslash
1 floor
89 & (vector calculus & $\nabla$ &

O. Scanned with OKEN Scanner


\hline
95 & angle bracket} &
Silang1eS &
\ textbackslash langle
Xhline
96 & numbers) & S\aleph$ a \
textbackslash aleph
\hline
97 & all) a $\forall$ &
Ntextbackslash fora11
\hline
98 & (logical and & S\neg$ a \
textbackslash neg \\
\hline gg & or)) & $\lor$ & \
textbackslash Ior
\hlzne
100 &
\ textbac kslash Longleftarrow
\hline

\end {center}
\end {document}
implied by (only if)) & $\Long1eftarrow$ &

O. Scanned with OKEN Scanner


\documentclass{article)
\ use pac kage{am smath)
\ use pac kage {colo r)
\ begin {document)
\begin{cente r}

\begin{enume
rate) \
item $
(a+b
\item $
$ (a+b
\ item $
\ item $
\item $

mma . $
Xitem $ (a 1+b 1B2+b IA2+2a 1b 1 .$
\ item $ (xhn {n -1}} .$
\item $ Xint x A n .S
\item $ . S
\item $ Nint sin\theta .$
\end {enume rate)

O. Scanned with OKEN Scanner


EX . NO
DATE :
MAKE A LETTER USING LATEX

AIM .
To make a letter using LATEX
LATEX CODE •

\doc umentclass [Ilpt {let te r}


LEAVE
LETTER \
begin{flushright}
PLACE :
DATE : DD .MM .YYYY .
\end{flushright}
From\\

I M .Sc Mathematics, \\ Sri


Sankara Arts and Science f
Enathur .

The HOD Department of


Sri Sankara Arts and Science, \\
Enathur .
Respected sir,
SUB : Application for leave .
Xend {cen te r)
Respectfully, I am suffe ring from a fever, so I cannot
come to college . So please grant me a leave for one day on
2 .2 .2@23
T shall be grateful to you

Thanking you,
Xend{center)

Yours
faithfully , \\ xxx
Xend{flushright}
Xend{document}
EX . NO
DATE :

MAKE A THEOREM USING LATEX

AIM .
To make a theorem using latex

LATEX CODE

O. Scanned with OKEN Scanner


\documen tclass [Ilpt {article}
\ use package {xcolc r}
\ usepac kage {am s sym b)

\begin{center} \texttt {Ncolor{magenta) TRANSITIVITY OF FINITE


EXTENSION} Xend{center)
\noindent
If L is an finite extension of K and if K is a
finite extension of F, then L is a finite extension of F . Moreover, [L [L [K :r-] . \ \
\ linebreak \noindent
\ {PROOF
Given that L is a finite extension of K and K is a finite extension of
\ linebreak TPT$\Rightarrow$ L is
a finite extension of . \\ \
linebreak
tm \medspace and \medspace j=1t2f , n X} $ is

Xlinebreak Let S v_1,v_2, be a basis of L over K . \ \ \linebreak Let


. N) $ be a basis of K over \ linebreak ILet t
$\epsilon$ L be any element .
\linebreak Every element in L can be expressed as a linear
combination of $ with coefficient in K Nlinebreak $\
thereforeS
$t=k IV 1+k 2v 2+ +k_mv_m $ { \cclo r{cyan} $ \ rightarrow$
\ textcircled{l}} where $k_i$ $\epsi10n$K and .m . \ linebreak
$\because$ $ \ { is a basis of K over F . \linebreak There exist scalars S f_{ij)$
. . pm and . , n in F such that
\ linebreak

\ linebreak

\ linebreak
{2n}
v
2w n+f {ml}v_mw_l+
.+ nS Xlinebreak S\the refo res t is expressed
as a linear combination of and . . . , n with coefficient in F . \\ \linebreak \noindent
{Xcolor{cyan} CLAIM \ { $v_iw . . tm and j=1t2t , n \ } is linearly independent . \
linebreak Let
2w_n+f_
N linebreak
f

is linearly independent of L over K. \linebreak $\the refore$ $

O. Scanned with OKEN Scanner


$\forall$

independent of K
1=1, 2,
over .
X linebreak $\therefore$ $\fo rall$ 2. and j=1,2,
\ linebreak $\the refore$ is a linearly independent
over F \\ Xlinebreak
$ \ is a basis of L over
\ linebreak $\therefc re$ The number cf elements in the basis is [L
ilinebreak SNtherefcreS [L [L [K Xend {document)

O. Scanned with OKEN Scanner


EX . NO
DATE :

CREATE A MATRIX TABLE IN LATEX


AIM .
To create a matrix table using LATEX
LATEX CODE •
idocumentclass{article)
Xusepackage [utf8j
{inputenc)
\ usepac kage {am smath}
\ usepac kage {colo r)

\color{magenta} {MATRIX) Nend {cente r)


PROBLEMS 1. If
$ A: \begin{pmatrix} 1 & 2 3& and
Then find S (i) A+B S (ii) A -e $ (iii) AB \noindent SOLUTION
Nnoindent (i) A+B =
$ \ begin {pmatrix} 1 a a Nend{pmatrix} $ +
$ \begin{pmatrix} @ 2 Xend{pmatrix} $ =
$ \ begin {pmatrix} 1 5 Xend{pmatrix} S . \ \
Nnoindent (ii) A -E =
$ \ begin {pmatrix} 1 Nend{pmatrix} $
$ \begin{pmatrix} @Xend{pmatrix} S = $ \begin{pmatrix}
1 Xend{pmatrix} $ .
\noindent (iii) AB =
$

Xend@natrix} $
Xbegin {pmat rix}
$ rix}
$ rix}
Xend{document)

O. Scanned with OKEN Scanner

You might also like