Eric Partlo edited Chapter_3_Typesetting_Mathematical_Formulae3__.html  over 8 years ago

Commit id: e7d2dd5d5863eda445148da0591e178f6ed555be

deletions | additions      

       

Chapter 3 - Typesetting Mathematical Formulae

3.1 The AMS-LATEX bundle
If you want to typeset (advanced) mathematics, you should use AMS-LATEX.  The AMS-LATEX bundle is a collection of packages and classes for mathematical typesetting.  AMS-LATEX is produced by The American Mathematical Society and it is used extensively for mathematical typesetting.  LATEX itself does provide some basic features and environments for mathematics, but they are limited and in some cases inconsistent.  

AMS-LATEX is a part of the required distribution and is provided with all recent LATEX distributions.  We assume amsmath is loaded in the preamble; \usepackage{amsmath}.

3.2 Single Equations
A mathematical formula can be typeset in-line within a paragraph (text style), or the paragraph can be broken and the formula typeset separately (display style).  Mathematical equations within a paragraph are entered between $ and $.
\(a^2 + b^2 = c^2\)
\(\lim_{x \to 2} f(x) = 5\)
\(\lim_{n \to \infty} \sum_{k=1}^n \frac{1}{k^2} = \frac{\pi^2}{6}\)

If you want to name the equation something specific, you \tag it instead.

3.2.1 Math Mode
There are also differences between math mode and text mode.  For example, in math mode:
  1. Most spaces and line breaks to not have any significance, as all spaces are either derived logically from the mathematical expressions, or have to be specified with special commands such as \, \quad or \qquad
  2. Empty lines are not allowed.  Only one paragraph per formula.
  3. Each letter is considered to be the name of a variable and will be typeset as such.  

Building  

\(\forall x \in \mathbf{R}: \qquad x^{2} \geq 0\)
\(x^{2} \geq 0\qquad \text{for all }x\in\mathbf{R}\)

3.3 Building  Blocks of a Mathematical Formula
Most of the commands in this section will not require amsmath, but load it anyways.  

Lowercase Greek Letters are entered as \alpha, \beta, \gamma, and uppercase letters are entered as \Gamma, \Delta, ...

Exponents, ...
\(\lambda, \xi, \pi, \theta, \mu, \Phi, \Omega, \Delta\)

Exponents,  Superscripts, and Subscripts can be specified using the ^ and _ characters.  Most math mode commands act only on the next character, so if you want a command to affect several characters, you have to group them together using curly braces: {...}.  

The  
\(p^3_{ij}\)
\(m_\text{Knuth}\)
\(\sum_{k=1}^3 k\)
\(a^x+y \neq a^{x+y}\)
\(e^{x^2}\)
\({e^x}^2\)

The  square root is entered as \sqrt; the nth root is generated with \sqrt[n].  The size of the root sign is determined automatically by LaTeX.  

The  
\(\sqrt{x} \Leftrightarrow x^{1/2}\)
\(\sqrt[3]{2}\)
\(\sqrt{x^{2} + \sqrt{y}}\)
\(\surd[x^2 + y^2]\)

The  dot sign to indicate the multiplication operation is normally left out, it is sometimes written tho help the eye in grouping a formula.  Use \cdot to typeset a single centered dot.  \cdots is three centered dots while \ldots sets the dots low (on the baseline).  Besides that, there are \vdots for vertical and \ddots for diagonal dots.  

The  
\(\Psi = v_1 \cdot v_2 \cdot \ldots\)
\(n! = 1 \cdot 2 \cdots (n-1) \cdot n\)


The  commands \overline and \underline create horizontal lines directly over or under an expression.  

The commands \overbrace and \underbrace create long horizontal braces over or under an expression.  

To add mathematical accents such as small arrows or tilde signs to variables, wide hats and tildes covering several characters are generated with \widetilde and \widehat.

The apostrophe mark ' gives a prime.  

Vectors are often specified by adding small arrow symbols on the tops of variables.  This is done with the \vec command.  The two commands \overrightarrow and \overleftarrow are useful to denote the vector from A to B.  

A built-up fraction is typeset with the \frac{...}{...} command.  

\partial command for partial derivatives is used.

To typeset binomial coefficients or similar structures, use the command \binom from amsmath.

The integral operator is generated with \int, the sum operator with \sum, and the product operator with \prod.  The upper and lower limits are specified with ^ and _ like subscripts and superscripts.  

3.4 Single Equations that are Too Long: multline