Become a L A T EX Guru - Math Mode Jason Gross 13 Week 2 - - - PowerPoint PPT Presentation

become a l a t ex guru math mode
SMART_READER_LITE
LIVE PREVIEW

Become a L A T EX Guru - Math Mode Jason Gross 13 Week 2 - - - PowerPoint PPT Presentation

L A T EX Modes Become a L A T EX Guru - Math Mode Jason Gross 13 Week 2 - Saturday, April 24, 2010 Jason Gross 13 Become a L A T EX Guru - Math Mode L A T EX Modes 1. Log in using the username sipb2 and the password


slide-1
SLIDE 1

L

A

T EX Modes

Become a L

AT

EX Guru - Math Mode

Jason Gross ’13 Week 2 - Saturday, April 24, 2010

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-2
SLIDE 2

L

A

T EX Modes

  • 1. Log in using the username sipb2 and the password

hsspMONSTER

  • 2. Once you are logged on, type

sudo apt-get install kile okular in the terminal and press enter.

  • 3. When prompted for a password, type the password you used

to log on (in this case, hsspMONSTER) and press enter. Do not worry if the password does not show up as you type it.

  • 4. When it asks you if you want to continue, type y and press

enter.

  • 5. When it is finished installing, type kile in the terminal, and

press enter.

  • 6. Find the file that you saved last class (on the desktop), and
  • pen it.

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-3
SLIDE 3

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

Text Mode

◮ Text mode is the standard L AT

EX mode.

◮ Lets you type things like “text”. ◮ If you try to type something like \alpha, ^ or other math

mode things, L

AT

EX complains and tells you ! Missing $ inserted. <inserted text> $

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-4
SLIDE 4

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

Math Mode

◮ Math mode lets you typeset mathematics, like α2 + β2 = γ2. ◮ Most things you do in text mode can be done in math mode

without L

AT

EX complaining.

◮ A few things will only work in text mode. ◮ \’a gives ´

a in text mode, but $\’a$ gives LaTeX Warning: Command \’ invalid in math mode on input line line number.

◮ (Almost) all spaces in math mode are ignored.

◮ Exception: If you want αa, you have to type $\alpha a$ (or

$\alpha a$ (or $\alpha a$ (or . . . ))), not $\alphaa$.

◮ If you don’t like this, you can instead type something like

$\alpha{}a$ or ${\alpha}a$.

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-5
SLIDE 5

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

Math Mode

◮ (Almost) all spaces in math mode are ignored.

◮ If you type $Hi, my name is Jason.$, you will get

Hi, mynameisJason.

◮ You can escape your spaces: $Hi,\ my\ name\ is\ Jason.$

gives Hi, my name is Jason.

◮ You can get from math mode to text mode with \text:

$\text{Hi, my name is Jason.}$ gives Hi, my name is Jason.

◮ If you just want an upright (roman) character, use \rm:

$\alpha \ne a = \rm a \ne \alpha$ gives α = a = a = α

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-6
SLIDE 6

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

Grouping

Grouping - {} groups things.

◮ $a^10$ gives a10, $a^{10}$ gives a10. ◮ Empty arguments: \LaTeX Guru gives L AT

EXGuru, \LaTeX{} Guru and {\LaTeX} Guru give L

AT

EX Guru.

◮ $a = {\rm a} = a$ gives a = a = a.

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-7
SLIDE 7

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

Entering Math Mode

◮ $\sum_i \frac{x^i}{i!}$ gives i xi i! . \( stuff \)

works the same way. (stuff )

◮ $stuff$ is (almost) the same as

\begin{math}stuff\end{math}. This is the math environment.

◮ $$\sum_i \frac{x^i}{i!}$$ gives

  • i

xi i!

◮ $$stuff$$ is (almost) the same as

\begin{displaymath}stuff\end{displaymath}.

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-8
SLIDE 8

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

Entering Math Mode

◮ The equation environment gives numbered equations:

  • i

xi i! (1)

◮ You can \tag your equations:

\begin{equation} E = mc^2 \tag{Einstein} \end{equation} gives E = mc2 (Einstein)

◮ The equation* environment is like $$ (unnumbered

equations, large spaces)

◮ \[stuff\] is (almost) the same as

\begin{equation*}stuff\end{equation*}

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-9
SLIDE 9

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

multiline

\begin{multline} a + b + c + d + e + f + g + h + i \\ = j + k + l + m + n \end{multline} a+b+c +d +e +f +g +h+i = j + k + l + m + n (2)

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-10
SLIDE 10

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

eqnarray

\begin{eqnarray} a & = & b + c \\ & = & d + e + f + g + h + i \nonumber \\ && {} + m + n + o \\ & = & p + q + r + s \end{eqnarray} a = b + c (3) = d + e + f + g + h + i + m + n + o (4) = p + q + r + s (5) \begin{eqnarray} a & = & a = a \end{eqnarray} a = a = a (6)

Bad!1

1See www.tug.org/pracjourn/2006-4/madsen/madsen.pdf on more

reasons why eqnarray is bad.

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-11
SLIDE 11

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

align

\begin{align} a & = b + c \\ & = d + e \end{align} a = b + c (7) = d + e (8)

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-12
SLIDE 12

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

align

\begin{align} a & = b + c \\ & = d + e + f + g + h + i + j + k + l \nonumber \\ & + m + n + o \\ & = p + q + r + s \end{align} a = b + c (9) = d + e + f + g + h + i + j + k + l + m + n + o (10) = p + q + r + s (11)

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode

slide-13
SLIDE 13

L

A

T EX Modes Text Mode Math Mode Grouping Getting into math mode Long Equations

align

\begin{align} a = {} & b + c \\ = {} & d + e + f + g + h + i + j + k + l \nonumber \\ & + m + n + o \\ = {} & p + q + r + s \end{align} a = b + c (12) = d + e + f + g + h + i + j + k + l + m + n + o (13) = p + q + r + s (14)

Jason Gross ’13 Become a L

A

T EX Guru - Math Mode