eLyXer Math Showcase
Alex Fernández (elyxer@gmail.com)
1 Introduction
This document is intended as a showcase of the mathematical abilities of eLyXer; for more information be sure to visit the
main page.
1.1 Versions
There are several versions of this page:
All of them are generated from the same .lyx source file; they should help you decide which rendering options suit you best.
Also available online is the eLyXer translation of the latest
LyX’s detailed Math manual, which contains a lot more examples of LyX maths.
2 Typography
Math formulae use a lot of different symbols and fonts.
2.1 Greek Symbols
Greek symbols are very important in equations: φ, π, Ξ. eLyXer offers a complete set in both upper case: Γ…Ω and lower case: α…ω. Also the AMS italicized upper case: Γ…Ω.
2.2 Math Symbols
2.3 Other Symbols
There are other symbols like arrows: ← → , or geometrical shapes: ○, □. eLyXer offers limited support for them. You might also want to use financial symbols in formulae: ¥€$.
2.4 Spacing
Equations look good when items are properly separated. The main separation is the Medium Mathematical Space:
x = 3.
Note: if you are viewing the non-Unicode version math.html of this page then you are in fact seeing midspaces, which are very similar but not exactly the same: (4)/(18) em for medium mathematical spaces versus (1)/(2) en, where 1 em = 2 en. Try out the Unicode version math-unicode.html — and viceversa. You can check out what version this page is in the page title.
The command
\raisebox is useful to, surprisingly, raise a little box,
raisedoverloweredand back.
Like
\mbox, it puts its content in a text box. It can also be used just for spacing:
B^{V}.
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.
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 ≠ Γ.
Function names should be upright: sin(2π), log(x), tanδ.
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) base^{super}_{sub}. 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.
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^{ km}⁄_{h}, or with a fraction before the units, ^{3}⁄_{2} km, (7)/(16) s.
3 Numeration
Equations can be numbered, like (
1↓)
And also like
(2↓).
Some equations can be numbered even if they don’t have a label.
Notice that equation (
2↑) comes after (
1↑).
4 Simple Structures
Let’s now see a few of the simpler structures that eLyXer can output.
4.1 Fractions
A simple fraction:
(1)/(2).
Inlined:
(2)/(3).
A big recursive fraction:
(1)/(⎛⎜⎝1 + ⎛⎜⎝(1)/(1 + ⎛⎝(1)/(1 + 2x)⎞⎠)⎞⎟⎠⎞⎟⎠)
A nice fraction:
^{5}⁄_{6}. 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:
⎛⎜⎝A B + 1⎞⎟⎠.
A symbol can be stacked over another using
\stackrel:
xR → y. Anything can be stacked:
dx > 3limx, headheels.
4.2 Limits
lim_{x → ∞}f(x) should appear as
x → ∞ in italics, and «lim» in plain style. In display mode, a limit must appear below the main symbol:
^{ }lim_{x → ∞}f(x).
Limits are also used in sums and integrals:
^{∞}⎲⎳_{i = 1}x, ^{∞}⌠⌡_{0}f(x) dx
where the sum’s limits should appear below (
i = 1) and above (
∞) the
∑. The placement of the integral limits depends on the document class: LaTeX standard classes place them right to the
∫. Limits are shown to the right in inline formulae:
∑^{∞}_{i = 1}x and
∫^{∞}_{i = 1}x.
The placing of limits can be configured with the
\limits and
\nolimits macros:
lim_{x → ∞}f(x), ⎲⎳^{∞}_{i = 1}x, ^{∞}⌠⌡_{0}f(x) dx
A square root:
√(3). A more complex root in a fraction:
(1)/(⎛⎝1 + √(2)⎛⎝(1)/(1 + √(2))⎞⎠ + √((1)/(2))⎞⎠).
eLyXer can also do higher-order roots:
^{3}√(x + y). A devilish case mixing everything we have seen so far:
(^{7⁄8}√((8)/(4)x) + ^{∞}⎲⎳_{i = 1}x)/(^{s + 5}√(((78x + 45y) × √(Ω))/(sin(x + 1)) + 38 km)).
5 Complex Structures
In this section we will explore arrays and related constructs.
5.1 Arrays
An inline array
⎡⎢⎣
a
b
c
d
⎤⎥⎦ is always shown in the same line. In display mode, the array is shown on its own line:
⎡⎢⎣
12
2
3
4 × y^{x}
⎤⎥⎦
Apart from that the appearance should be the same.
5.2 Brackets
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, e.g. ⟨f⟩.
Used to switch between 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
5.4 Braces
Values can be underbraced or overbraced.
a − b = b + c + d + e.
6 Macros
Now it’s time for user-defined commands (sometimes called “macros”).
Definitions can be added as macros. Then they can be used in formulae: ^{1}√(2). They can accept default parameters. Again, useful in formulae: ^{4}√(5).
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).