Sie sind auf Seite 1von 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

a1,1 a1,2 a1,n


a2,1 a2,2 a2,1

Am,n = ..
..
..
.
.
.
.
.
.
am,1 am,2 am,n
In some cases you may want to have finer 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-specified:
1 2
3 4
You may notice that the AMS matrix class of environments doesnt leave enough space used
together with fractions resulting in output similar to this
5 1
5 1
0
0
6
6
6
6

M 0 = 65 0 16
M = 65 0 16
0 56 16
0 56 61
If you need border or indexes on your matrix, plain TEX provides the macro \bordermatrix

M=

A
B

x y

1 0
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: ac db to not increase leading in a portion of text.
There are noticeable problems: there are no spaces between 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 (LATEX spaces mathematics
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 text can be added properly. The typical way is to wrap
the text with the \text{...} command (a similar command is \mbox{...}, though this causes
problems with subscripts, and has a less descriptive name). Lets see what happens when the
above 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 are
specifically aimed at text in math mode (requires amsfonts)
1

LATEX command
\mathnormal{...}
or
simply
command

omit

any

Sample
ABCDEF abcdef

mathrm{...}

ABCDEFabcdef123456

mathit{...}

ABCDEFabcdef123456

\mathbf{...}

ABCDEFabcdef123456

\mathsf{...}

ABCDEFabcdef123456

\mathtt{...}

ABCDEFabcdef123456

\mathcal{...}

\mathscr{...}

(requires the mathrsfs package)

Italicised font

Bold font

Calligraphy
(uppercase only)

ABCDEF

Blackboard
bold
(uppercase only)
Script
only)

A BC DE F

Common use
Most mathematical
notation
Units of measurement, one word
functions
Multi-letter function or variable
names. Compared
to
\mathnormal,
words are spaced
more
naturally
and numbers are
italicised as well.
Vectors

Sans-serif
Monospace (fixedwidth) font

ABCDEF

\mathbb{...}
(requires the amsfont or
amssymb package)

Description
The default math
font
This is the dafault
or normal font unitalicised

(uppercase

Often used for


sheaves/schemes
and
categories,
used to denote
cryptological concepts
like
an
alphabet
space,
key space. Naming convention in
Logic;
Laplace
transform
and
Fourier transform
Used to denote special sets (e.g. real
numbers)
An alternative font
for categories and
sheaves.

These formatting commands can be wrapped around the entire equation, and not just on
the textual elements: they only format letters, numbers, and uppercase Greek, and other math
commands are unaffected.
To bold lowercase Greek or other symbols use the \boldsymbol command; this will only work
if there exists a bold version of the symbol in the current font. As a last resort there is the \pmb
command (poor mans bold): this prints multiple versions of the character slightly offset against
2

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
0
a or a^{\prime}
a
a
\hat{a}
a

\bar{a}
\grave{a}
a
`
\acute{a}
\dot{a}
a
\ddot{a}
\not{a}
6a
\mathring{a}

\overrightarrow{ABC} ABC \overleftarrow{ABC}


a
a000
a
\overline{aaa}
aaa
\check{a}
\breve{a}
a

\vec{a}
...
a
\dddot{a}
\ddddot{a}
[
\widehat{AAA}
AAA
\widetilde{AAA}
\tilde{a}
a

\underline{aaa}

Result
a00
a

ABC
a0000
a

~a
....
a
]
AAA
aaa

The package xcolor, allows us to add color to our equations. For example.
k = {\color{red}x}\mathbin{\color{blue}-}2
k=\textcolor{red}{x}\textcolor{blue}{-}\textcolor{green}{2}

k =x2
k = x2

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 is
assumed to be a binary operator, and as such, allocates some space at either side of the sign. The
alternative way is a sign designation. This is when you state whether a mathematical quantity is
either positive or negative. This is common for the latter, as in maths, such elements are assumed
to be positive unless a is prefixed to it. In this instance, you want the sign to appear close to
the appropriate element to show their association. If you put a + or a with nothing before it
but you want it to be handled like a binary operator using . This can be useful if you are writing
multiple-line formulas, and a new line could start with a = or a +, for example, then you can fix
some strange alignments adding the invisible character where necessary.
Command
\pm
\mp
(a \pm b)^2 = a^2\pm 2ab+b^2
(a \pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3
\cos(a\pm b)=\cos{a}\cos{b}\mp \sin{a}\sin{b}
Controlling horizontal spacing in LATEX
(
n/2
f (n) =
(n + 1)
3

Result

2
(a b) = a2 2ab + b2
(a b)3 = a3 3a2 b + 3ab2 b3
cos(a b) = cos a cos b sin a sin b

if n is even
if n is odd

Ok, so back to the fine tuning as mentioned at the beginning of the document. A good example
would be displaying the simple equation for the indefinite integral of y with respect to x:
Z
\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 some
text some text some text some text some text some text some text some text some text
Command Description
\,
small space
\:
medium space
\;
large space
\!
negative space

Size
3/18 of a quad
4/18 of a quad
5/18 of a quad
-3/18 of a quad

Das könnte Ihnen auch gefallen