figure elyxer.png eLyXer Math Showcase

Alex Fernández (elyxer@gmail.com)

Table of Contents

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.

2 Typography

Math formulae use a lot of different symbols and fonts.

2.1 Greek Symbols

Greek symbols are very important in equations: \phi, \pi, \Xi. eLyXer offers a complete set in both upper case: A\Omega and lower case: \alpha\omega. Also the AMS italicized upper case: \varGamma\varOmega.

2.2 Math Symbols

eLyXer supports the whole set of math symbols in John D. Cook's list: \exists\partial\nabla\geq. It can also render a few more: \propto\times. You also get all symbols from Markus Kuhn's list: \bigodot\amalg.

2.3 Other Symbols

There are other symbols like arrows: \leftarrow\rightarrow, or geometrical shapes: \circ, \square. eLyXer offers limited support for them. You might also want to use financial symbols in formulae: \yen\euro\$.

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: \frac{4}{18}\mathrm{em} for medium mathematical spaces versus \frac{1}{2}\mathrm{en}, where 1\mathrm{em}=2\mathrm{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.
\raisebox{2mm}{raised}over\raisebox{-2mm}{lowered}\textrm{and back}.
It can also be used just for spacing.
\raisebox{5mm}{}B^{V}.
There are other spacing commands: \hspace: "\hspace{4mm}", \vspace: "\vspace{1cm}", protected space: a\ b.

2.5 Fonts

Many fonts are used in equations.
Regular text is shown italicized. Variable: length, \alpha, Speed.
Some font styles can be used in equations. Roman: 1\mathrm{mathrm}. Sans serif: 2\mathsf{mathsf}. Typewriter: 3\mathtt{mathtt}. Bold: 4\mathbf{mathbf}.
Regular text. Normal text: 5\textrm{textfm}. Literal text: 6\mbox{mbox text}. Phonetic alphabet: 7\text{\textipa{abcde}}.
Units can be shown with or without a magnitude. Withouth: \unit{km}. With: \unit[57]{km}. With fractional units: \unitfrac[200]{km}{h}. With a fraction before the units: \unit[\nicefrac{3}{2}]{km}, \unit[\frac{7}{16}]{s}.
Some special fonts are supported: \mathscr{mathscr}, \mathcal{MATHCAL}, \mathbb{MATHBB}, \mathfrak{mathfrak}. For those, some single characters are translated to their Unicode equivalents: \mathscr{F}, \mathbb{F}, \mathfrak{F}.

3 Numeration

Equations can be numbered, like .
\begin{equation} y=x\label{eq:first}\end{equation}
And also like .
\begin{equation} x=3\label{eq:second}\end{equation}
Some equations can be numbered even if they don’t have a label.
\begin{equation} x=2y\end{equation}
Notice that comes after .

4 Simple Structures

Let’s now see a few of the simpler structures that eLyXer can output.

4.1 Fractions

A simple fraction:
\frac{1}{2}.
Inlined: \frac{2}{3}.
A big recursive fraction:
\frac{1}{\left(1+\left(\frac{1}{1+\left(\frac{1}{1+2x}\lyxlock\right)}\lyxlock\right)\right)}\lyxlock
A nice fraction: \nicefrac{5}{6}. A non-diminishing fraction containing alignments:
\cfrac{1}{1+\left(\cfrac[l]{1}{1+x}\times\cfrac[r]{1}{1+x}\right)}.
A similar concept is a binomial coefficient: \binom{A+1}{B}. It can be prettily presented:
\dbinom{A}{B+1}.
A symbol can be stacked over another using \stackrel: x\stackrel{R}{\rightarrow}y. Anything can be stacked: d\stackrel{x>3}{\lim}x, \stackrel{head}{heels}.

4.2 Limits

A limit must appear below the main symbol:
\lim_{x\rightarrow\infty}\lyxlock f(x),
which should appear as x\rightarrow\infty in italics, and «lim» in plain style. Note that in HTML the limit does not actually appear below the «lim» but to the right. Inlined: \lim_{x\rightarrow\infty}\lyxlock f(x).
Limits are also used in sums:
\sum_{i=1}^{\infty}x,
where the sum’s limits should appear below (i=1) and above (\infty) the \sum. Again, in HTML the limits are shown to the right. Inlined: \sum_{i=1}^{\infty}x. Also in integrals: \intop_{i=1}^{\infty}x.

4.3 Roots

A square root: \sqrt{3}. A more complex root in a fraction:
\frac{1}{\left(1+\sqrt{2}\left(\frac{1}{1+\sqrt{2}}\lyxlock\right)+\sqrt{\frac{1}{2}}\right)}\lyxlock.
eLyXer can also do higher-order roots: \sqrt[3]{x+y}. A devilish case mixing everything we have seen so far:
\frac{\sqrt[\nicefrac{7}{8}]{\frac{8}{4}x}+\sum_{i=1}^{\infty}x}{\sqrt[s+5]{\frac{(78x+45y)\times\sqrt{\Omega}}{\sin(x+1)}+\unit[38]{km}}}\lyxlock.

5 Complex Structures

In this section we will explore arrays and related constructs.

5.1 Arrays

An inline array \left[\begin{array}{cc} a & b\\ c & dio\end{array}\right]: is always shown in the same line.
An independent array is shown on its own line:
\left[\begin{array}{lc} 12 & 2\\ 3 & 4\times y^{x}\end{array}\right]
Apart from that the appearance should be the same.

5.2 Brackets

Arrays are separated by brackets: \left(a\right) \left[b\right] \left\{ c\right\} \left\langle d\right\rangle \left|e\right|. There are also big brackets: \bigl\langle f\bigr\rangle.

5.3 Cases

Used to switch between several values.
y=\begin{cases} x & i=0,\\ x+1 & i<3\end{cases}

5.4 Braces

Values can be underbraced or overbraced.
\underbrace{a-b}=\overbrace{b+c+d+e}.

6 Macros

Now it’s time for user-defined commands (sometimes called “macros”).
Definitions can be added as macros \newcommand{\stupidroot}[2]{\sqrt[#1]{#2}} {\sqrt[#1]{#2}} . Then they can be used in formulae: \stupidroot 12. They can accept default parameters \newcommand{\defaultroot}[2][4][5]{\sqrt[#1]{#2}} {#1\sqrt{#2}} . Again, useful in formulae: \defaultroot.
Other definitions from the preamble can be used: \preambleroot{3}{4}.
Definitions on the fly are also possible: \newcommand{\ontheflyroot}[2]{\sqrt[#1]{#2}}\ontheflyroot{7}{8}, and used with different values: \ontheflyroot{a}{b}.

7 The End

That’s all folks!