untitled 1 test

4
Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text A m,n  = a 1,1  a 1,2  ···  a 1,n a 2,1  a 2,2  ···  a 2,1 . . .  . . .  . . .  . . . a m,1  a m,2  ··· a m,n In some cases you may want to have ner control of the alignment within each column, or want to insert lines between columns or rows. This can be achieve using the  array environment, which requires that the columns be pre-specied: 1 2 3 4 You may notice that the AMS matrix class of environments doesn’t leave enough space used together with fractions resulting in output similar to this M  = 5 6 1 6  0 5 6  0  1 6 0  5 6 1 6  M  = 5 6 1 6  0 5 6  0  1 6 0  5 6 1 6 If you need “border” or “indexes” on your matrix, plain T E X pro vide s the macro \bordermatrix M  = x y A  1 0 B  0 1 To insert a small matrix, and not increase the leading in the line containing it, use the  smallmatrix environment: A matrix in text must be set smaller: a b c d  to not increase leading in a portion of text. There are noticeable problems: there are no space s betw een words or numbers, and the letters are italicized and more spaced out that normal. Both issues are simply artifacts of the math mode, in that it treats it as a mathematical expression: spaces are ignored (L A T E X spa ces ma the matics according to its own rules), and each character is a separate element (so are not positioned as closely as normal text). There are a number of ways that tex t can be added proper ly . The ty pical way is to wrap the text with the  \text{...} command (a similar command is  \mbox{...} , though this causes problems with subscripts, and has a les s descriptive name). Let’s see what happens whe n the above equation code is adapted: 50 apples × 100 apples = lots of apples 2 We can now format text, what about formatting mathematical expressions? Ther e are a set of formatting commands very similar to the font formatting ones just used, except that they are specically aimed at text in math mode (requires  amsfonts) 1

Upload: robchiosh

Post on 05-Jul-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Untitled 1 test

8/15/2019 Untitled 1 test

http://slidepdf.com/reader/full/untitled-1-test 1/4

Some text Some text Some text Some text Some text Some text Some text Some text Sometext Some text Some text Some text Some text Some text Some text Some text Some text Sometext

Am,n =

−a1,1   a1,2   · · ·   a1,n

a2,1   −a2,2   · · ·   a2,1...

  ...  . . .

  ...am,1   am,2   · · · −am,n

In some cases you may want to have finer control of the alignment within each column, or wantto insert lines between columns or rows. This can be achieve using the  array environment, whichrequires that the columns be pre-specified:

1 23 4

You may notice that the AMS matrix class of environments doesn’t leave enough space usedtogether with fractions resulting in output similar to this

M  =

5

616

  056   0   1

6

0   56

16

  M  =

56

16   0

56   0   1

6

0   56

16

If you need “border” or “indexes” on your matrix, plain TEX provides the macro  \bordermatrix

M  =

x y

A   1 0B   0 1

To insert a small matrix, and not increase the leading in the line containing it, use the  smallmatrix

environment:A matrix in text must be set smaller:

a bc d

 to not increase leading in a portion of text.

There are noticeable problems: there are no spaces between words or numbers, and the lettersare italicized and more spaced out that normal. Both issues are simply artifacts of the math mode,in that it treats it as a mathematical expression: spaces are ignored (LATEX spaces mathematicsaccording to its own rules), and each character is a separate element (so are not positioned asclosely as normal text).

There are a number of ways that text can be added properly. The typical way is to wrapthe text with the   \text{...}  command (a similar command is   \mbox{...}, though this causesproblems with subscripts, and has a less descriptive name). Let’s see what happens when theabove equation code is adapted:

50 apples × 100 apples = lots of apples2

We can now format text, what about formatting mathematical expressions? There are a set of formatting commands very similar to the font formatting ones just used, except that they arespecifically aimed at text in math mode (requires   amsfonts)

1

Page 2: Untitled 1 test

8/15/2019 Untitled 1 test

http://slidepdf.com/reader/full/untitled-1-test 2/4

Page 3: Untitled 1 test

8/15/2019 Untitled 1 test

http://slidepdf.com/reader/full/untitled-1-test 3/4

each other.β = (β 1, β 2, . . . , β  n)   α, α, α,

Accents; so what to do when you run out of symbols and fonts? well the next step is to use

accents:Command Result Command Result

a’  or   a^{\prime}   a a’’   a

\hat{a}   a   \bar{a}   a\grave{a}   a   \acute{a}   a

\dot{a}   a   \ddot{a}   a\not{a}   a   \mathring{a}   a

\overrightarrow{ABC}  −−−→

ABC    \overleftarrow{ABC}  ←−−−

ABC a’’’   a a’’’’   a

\overline{aaa}   aaa   \check{a}   a

\breve{a}   a   \vec{a}   a\dddot{a}

  ...a   \ddddot{a}

  ....a

\widehat{AAA}    AAA   \widetilde{AAA}   AAA\tilde{a}   a   \underline{aaa}   aaa

The package   xcolor, allows us to add color to our equations. For example.

k = {\color{red}x}\mathbin{\color{blue}-}2   k =  x − 2

k=\textcolor{red}{x}\textcolor{blue}{-}\textcolor{green}{2}   k =  x−2

Plus and minus signs; LATEX deals with the + and   −   signs in two possible ways. The most

common is as a binary operator. When two math elements appear on either side of the sign, it isassumed to be a binary operator, and as such, allocates some space at either side of the sign. Thealternative way is a sign designation. This is when you state whether a mathematical quantity iseither positive or negative. This is common for the latter, as in maths, such elements are assumedto be positive unless a  −  is prefixed to it. In this instance, you want the sign to appear close tothe appropriate element to show their association. If you put a + or a  −  with nothing before itbut you want it to be handled like a binary operator using . This can be useful if you are writingmultiple-line formulas, and a new line could start with a = or a +, for example, then you can fixsome strange alignments adding the invisible character where necessary.

Command Result

\pm   ±\mp   ∓

(a \pm b)^2 = a^2\pm 2ab+b^2   (a ± b)2 = a2 ± 2ab + b2

(a \pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3   (a ± b)3 = a3 ± 3a2b + 3ab2 ± b3

\cos(a\pm b)=\cos{a}\cos{b}\mp \sin{a}\sin{b}   cos(a ± b) = cos a cos b ∓ sin a sin b

Controlling horizontal spacing in LATEX

f (n) =

n/2 if  n is even

−(n + 1) if   n is odd

3

Page 4: Untitled 1 test

8/15/2019 Untitled 1 test

http://slidepdf.com/reader/full/untitled-1-test 4/4

Ok, so back to the fine tuning as mentioned at the beginning of the document. A good examplewould be displaying the simple equation for the indefinite integral of  y  with respect to  x:

\int y \; \mathrm{d}x 

  y dx

some text some text some text some text some text some text some text some text some text sometext some text some text some text some text some text some text some text some text

Command Description Size

\,   small space 3/18 of a quad\:   medium space 4/18 of a quad\;   large space 5/18 of a quad\!   negative space -3/18 of a quad

4