Professional Documents
Culture Documents
Basic L TEX Typesetting: A Hands-On Seminar For Math Training Elective
Basic L TEX Typesetting: A Hands-On Seminar For Math Training Elective
Basic L TEX Typesetting: A Hands-On Seminar For Math Training Elective
Kiel F. Granada
Session 1
July 17, 2010
What is LATEX?
pdflatex
TEXMAKER Basics
\ documentclass [ options ]{ a r t i c l e }
preamble
%comments
\ b e g i n { document }
body
\ end { document }
General Syntax
command format
\command [ o p t i o n s ] { a rgument }
environment markers
\ begin { environment }
content
\ end { e n v i r o n m e n t }
Achtung!
LATEX is case-sensitive.
Exercise 1
1. Launch TEXMAKER.
2. Create a new file.
3. Type the following basic structure:
\ documentclass{ a r t i c l e }
\ b e g i n { document}
\ end { document}
Exercise 1
Document Classes
Document Options
\documentclass[options]{article}
Font Size 10pt, 11pt, 12pt
Paper Size a4paper, letterpaper
Orientation landscape
Layout twocolumn
Equation Display fleqn, leqno
Example
\ d o c u m e n t c l a s s [ 1 1 pt , twocolumn ] { a r t i c l e }
Preamble Contents
Document Labels
(title, subtitle, author, institute, date)
Package Declarations
Syntax: \usepackage{package1, package2, }
Exercise 2
Exercise 2
Note
Close PDF reader before running pdflatex.
Follow-up Exercise
Try out the options: 11pt, 12pt, twocolumn
Simplest Declaration
\pagestyle{empty}
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\textwidth}{7.27in}
\setlength{\textheight}{10.69in}
\doublespacing
\singlespacing
\onehalfspacing
Other Declarations
Handy Commands
\definecolor{darkblue}{rgb}{0,0.08,0.45}
\color{darkblue}
\DeclareMathOperator{\cis}{cis}
\usepackage[none]{hyphenat}
Exercise 3
Font size: 12 pt
Orientation: portrait
Layout: two-column
Margins: 1.5 left, 1 right, 1.25 top and bottom
Spacing: double-spaced
Hyphenation: on
white spaces \, \: \;
spaces between paragraphs
\smallskip, \medskip, \bigskip, \vspace{1in}
new line \newline or \\
new page \newpage
remove indentation \noindent
Paragraph Alignments
left
center
right
Font Sizes
Font Styles
\textbf{text} text
\underline{text} text
\textit{text} text
\emph{text} text
\texttt{text} text
List Environments
Exercise 4 Decode Me
Math Modes
paragraph mode
display mode
Math Modes
Example: Source
From Eq . 1 , we have
$$ 2 ( 1 ) ( 2) + z = 5 $$
$$2 + 2 + z = 5 $$
T h e r e f o r e , $z = 1 $ .
Math Modes
Example: Output
2(1) (2) + z = 5
2+2+z =5
Therefore, z = 1.
Tip
You may use TEXMAKERs Math dropdown menu.
Basic Operations
+
\ times
\ div
\pm
Relation Symbols
<
=
>
\leq
\ geq
\ neq
{ s u p e r s c r i p t }
{ subscript }
a
b
\ f r a c { n u m e r a t o r }{ d e n o m i n a t o r }
\ d f r a c { n u m e r a t o r }{ d e n o m i n a t o r }
\ sqrt { radicand}
\ sqrt [ index ]{ radicand}
\ mathbb{N, W, Z , Q, R} N, W, Z, Q, R
\Re
\ f o r a l l x \ i n \ mathbb{Z} x Z
\ e x i s t s y \ n o t \ i n \ mathbb {N} y
6 N
A \ cup B AB
A \ cap B AB
Equations
\ begin{ equation }
n P r = \ d f r a c {n ! } { ( nr ) ! } n!
\ end { e q u a t i o n } n Pr = (1)
(n r )!
\ begin{ equation }
n C r = \ d f r a c {n ! } { ( nr ) ! r ! }
n!
\ end { e q u a t i o n } n Cr = (2)
(n r )!r !
\ b e g i n { e q u a t i o n }
n C r = n C {nr }
\ end { e q u a t i o n } n Cr =n Cnr
Note
The equation environment is not written inside $ $.
KFGranada Basic LATEX Typesetting
Introduction
Math Modes
The TEX Document Structure
Some Math Symbols and Commands
General Formatting
Useful Math Structures
The Math Environment
Equation Arrays
\ b e g i n { e q n a r r a y }
x &=& 5 ( 1) + 3\\
&=& 5 + 1 + 3\\ x = 5 (1) + 3
x &=& 9 = 5+1+3
\ end { e q n a r r a y } x = 9
\ begin { eqnarray }
e q u a t i o n 1 & a l i g n h e r e &\\
e q u a t i o n 2 & a l i g n h e r e &\\
e q u a t i o n 3 & a l i g n h e r e&
\ end { e q n a r r a y }
\ begin { proof }
I ha ve d i s c o v e r e d a t r u l y r e m a r k a b l e p r o o f
whi ch t h i s ma rgi n i s t o o s m a l l t o c o n t a i n .
\ end { p r o o f }
Proof.
I have discovered a truly remarkable proof which this margin is
too small to contain.
Assignment
Part 1
Encode the proof that 2 is irrational.
Part 2
Encode the derivation of the quadratic formula.