Math Test

1 Limits

A limit:
limx → ∞f(x), 
which should appear as x → ∞ in italics, and «lim» in plain style. Inlined: limx → ∞f(x).
And why not, a sum:
i = 1ai, 
where the sum’s limits should appear below (i = 1) and above () the but to the right. Inlined: i = 1ai. Integral: x = ax dx. Display mode:
x = ax dx.
We can also integrate without limits: A dx.
A sum inside another element (red color):
i = 1ai.
The placing of limits can be cofigured with the \limits and \nolimits macros:
limx → ∞f(x),  i = 1x,  0f(x) dx

1.1 Super- and Subscript

When any element has both super- and subscript, they should appear like inlined limits, one above the other: a34. Also before an element: 32 He. In display mode:
i, jaij + i, jaji = iaii, 
21 H + 21 H → 32 He + 10 n.

2 Numeration

Equations can be numbered, like 1↓.
(1) y = x
And also like 2↓.
(2) x = 3
Notice that eq. 2↑ comes after eq. 1↑.
Some equations can also be numbered, even if they don’t have a label.
(3) x = 2y
Other equations that contain * should not numbered, but perhaps aligned:
left right
Some environments allow for multiple labels:
(4) a  =  b × c (5) c × d × e  =  i.
Now a random environment: x y.

3 Brackets

An array:
12 2 3 4 × yx
And an inline array a b c dio .
Arrays are separated by variable-size brackets: a b c d a b c d a b c d a b c d ||| a b c d |||which might also differ on right and left a b c d or use the empty opening a b c d or closing: a b c d |||. There are also fixed-size big brackets: (a) [b] {c} d |e| f.
Aligned brackets can be present: (toText). One of them may be omitted: toText).
Aligned brackets can be applied to complex items:
s × 1 +  a11 a21 a12 a22  ×  1  − 1  − 1  − 1  +  1  − 1 0  − 1 1 0 0 0 r .
Math brackets should not be mistaken for TeX brackets: ({s(x)})/(2).

4 Fraction

A big recursive fraction:
(1)/(1 + (1)/(1 + (1)/(1 + 2x)))
A nice fraction: 56.
A non-diminishing fraction containing alignments:
(1)/(1 + (1)/(1 + x) × (1)/(1 + x)).
A similar concept is a binomial coefficient: (A + 1B). It can be prettily presented:
AB + 1.
A symbol can be stacked over another using \stackrel: xR → y. Anything can be stacked: headheels.

5 Roots

A square root: (3). A root in a fraction: (((78x + 45y) × (Height))/(sin(x + 1)) + 5).
A more complex square root in a fraction:
(1)/(1 + (2)(1)/(1 + (2)) + ((1)/(2))).
Higher order roots: 3(x + y), x + 1(Weight). In a fraction:
(78((8)/(4)x))/(s + 5(((78x + 45y) × (Height))/(sin(x + 1)) + 5)).

6 Decorations

6.1 Cases

Used to switch several values.
y =  x i = 0,         x + 1  i < 3 
Cases may have more than two rows:
f(x) =  0  x < 0,         ∞  x = 0,         0  x > 0 

6.2 Braces

Values can be underbraced or overbraced.
a − b = c + d + e + f.
Underbraces and overbraces can contain text.
a − bover = c + d + eover + funder + g.
They can also be inlined: a + bover.

7 Spacing

The command \raisebox is useful to, surprisingly, raise a little box,
raisedoverlowered and back.
Like \mbox, it puts its content in a text box. It can also be used just for spacing:
BV.
There are other spacing commands: \hspace a b, protected space a b, and at “block level” \vspace: a b.
There should be 1 cm of vertical space above this paragraph.

8 Fonts

This section tests font support.

8.1 Variables and Functions

By default, letters denote variables and are taken from the \mathnormal font, which is italic: αx + αy = α(x + y), with the exception of upright capital Greek letters, G ≠ Γ. Letters run together represent different variables: abcd = a × b × c × d.
There has been some trouble over some commands like Greek letters; some of them should be italicized, as in: μ or Å. Others should not, as in Ω. Upright Greek letters are also available: μ ≠ μ. An example from the LyX math guide:
π +  → μ +  + νμ.
Functions names should be upright: sin(2π), log(x), tanδ.

8.2 Mathematical Fonts

Mathematical fonts used in equations include Roman (\mathrm), Sans Serif (\mathsf), Typewriter (\mathtt), Bold (\mathbf), SCRIPT (\mathscr), CALLIGRAPHIC (\mathcal), BLACKBOARD BOLD (\mathbb), and Fraktur (\mathfrak). For the latter, some single characters are translated to their Unicode equivalents: , 𝔽, 𝔉.
Regular text in a formula can be achieved via text font commands like \textrm: 5  to 10, via boxes like \mbox (prevents line breaks): 6  is more than 5, or the AMSmath \text macro (scales like math symbols) basesupersub. The content of an mbox is processed in LaTeX text mode. This allows text font commands, e.g. a switch to sans-serif-bold-italic, or the phonetic alphabet: sfbfit, tipa.

8.3 Units

Units should be written upright, either with \mathrm or with macros from the units package, e.g. as simple unit, km, with magnitude, 57 km, with fractional unit, 200 kmh, or with a fraction before the units, 32 km, (7)/(16) s.

8.4 Sizes

Sizes can be specified in formulas: display, text, script, scriptscript.

9 Colors and Boxes

A colored box: aaa.
A framed box: box. It can be aligned left: box or right: box.

10 Macros

Definitions can be added as macros. Then they can be used in formulae: (12) + 1(2).
Macro definitions can accept default parameters. Again, useful in formulae: 4(5). Default parameters can then be overriden: 5(y) + x(4).
Other definitions from the preamble can be used: 3(4).
Definitions on the fly are also possible: 7(8), and used with different values: a(b).
Macros may contain a literal parameter. It should parse correctly: t.
A macro with four parameters from the LyX detailed math guide. Now in use: 1 + x1,  2 =  − ((1 − x))/(2)±(((1 − x)2)/(4) − 5) − B.

11 Pathological Cases

Empty equations have been known to fail: .
An equation with an mbox containing a comment: text more, and a comment inside textrm: text more. Finally, a comment at the end of a text function: only text.

12 Bye-bye

That’s all folks!