figure elyxer.png eLyXer Math Showcase

Alex Fernández (

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.
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: \phi, \pi, \Xi. eLyXer offers a complete set in both upper case: \Gamma\ldots\Omega and lower case: \alpha\ldots\omega. Also the AMS italicized upper case: \varGamma\ldots\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}.
Like \mbox, it puts its content in a text box. It can also be used just for spacing:
There are other spacing commands: \hspace: a\hspace{4mm}b, protected space: a\ b, and (at “block level”) \vspace: a\vspace{1cm}b.
There should be 1 cm of vertical space above this paragraph.

2.5 Fonts

By default, letters denote variables and are taken from the \mathnormal font, which is italic, \alpha x+\alpha y=\alpha(x+y), with the exception of upright capital Greek letters, G\ne\Gamma.
Function names should be upright: \sin(2\pi),\log(x),\tan\delta.
Mathematical fonts used in equations include \mathrm{Roman} (\mathrm), \mathsf{Sans\: Serif} (\mathsf), \mathtt{Typewriter} (\mathtt), \mathbf{Bold} (\mathbf), \mathscr{SCRIPT} (\mathscr), \mathcal{CALLIGRAPHIC} (\mathcal), \mathbb{BLACKBOARD\: BOLD} (\mathbb), and \mathfrak{Fraktur} (\mathfrak). For the latter, some single characters are translated to their Unicode equivalents: \mathscr{F}, \mathbb{F}, \mathfrak{F}.
Regular text in a formula can be achieved via text font commands like \textrm: 5\:\textrm{to}\:10, via boxes like \mbox (prevents line breaks): 6\mbox{ is more than }5, or the AMSmath \text macro (scales like math symbols) \text{base}_{\text{sub}}^{\text{super}}. 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: \mbox{\textbf{\textsf{\textbf{\textit{sfbfit}}}}, \textipa{tipa}}.
Units should be written upright, either with \mathrm or with macros from the units package, e.g. as simple unit, \unit{km}, with magnitude, \unit[57]{km}, with fractional unit, \unitfrac[200]{km}{h}, or with a fraction before the units, \unit[\nicefrac{3}{2}]{km}, \unit[\frac{7}{16}]{s}.

3 Numeration

Equations can be numbered, like () And also like (↓). Some equations can be numbered even if they don’t have a label.
Notice that equation () 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:

Inlined: \frac{2}{3}.
A big recursive fraction:

A nice fraction: \nicefrac{5}{6}. A non-diminishing fraction containing alignments:

A similar concept is a binomial coefficient: \binom{A+1}{B}. It can be prettily presented:

A symbol can be stacked over another using \stackrel: x\stackrel{R}{\rightarrow}y. Anything can be stacked:


4.2 Limits

\lim_{x\rightarrow\infty}f(x) should appear as x\rightarrow\infty in italics, and «lim» in plain style. In display mode, a limit must appear below the main symbol:

\lim_{x\rightarrow\infty}\lyxlock f(x).
Limits are also used in sums and integrals:

where the sum’s limits should appear below (i=1) and above (\infty) the \sum. The placement of the integral limits depends on the document class: LaTeX standard classes place them right to the \int. Limits are shown to the right in inline formulae: \sum_{i=1}^{\infty}x and \intop_{i=1}^{\infty}x.
The placing of limits can be configured with the \limits and \nolimits macros:

\lim\nolimits _{x\rightarrow\infty}\lyxlock f(x),\;\sum\nolimits _{i=1}^{\infty}x,\;\int\limits _{0}^{\infty}f(x)\,\mathrm{d}x

4.3 Roots

A square root: \sqrt{3}. A more complex root in a fraction:

eLyXer can also do higher-order roots: \sqrt[3]{x+y}. A devilish case mixing everything we have seen so far:


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 & d\end{array}\right] is always shown in the same line. In display mode, the array is shown on its own line:

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 variable-size brackets: \left(\begin{array}{cc}
a & b\\
c & d\end{array}\right) \left[\begin{array}{cc}
a & b\\
c & d\end{array}\right] \left\{ \begin{array}{cc}
a & b\\
c & d\end{array}\right\} \left\langle \begin{array}{cc}
a & b\\
c & d\end{array}\right\rangle \left|\begin{array}{cc}
a & b\\
c & d\end{array}\right|which might also differ on right and left \left(\begin{array}{cc}
a & b\\
c & d\end{array}\right) or use the empty opening \left\{ \begin{array}{cc}
a & b\\
c & d\end{array}\right. or closing: \left.\begin{array}{cc}
a & b\\
c & d\end{array}\right|. There are also fixed-size big brackets, e.g. \bigl\langle f\bigr\rangle.

5.3 Cases

Used to switch between several values.

x & i=0,\\
x+1 & i<3\end{cases}
Cases may have more than two rows:

0 & x<0,\\
\infty & x=0\\
0 & x>0\end{cases}

5.4 Braces

Values can be underbraced or overbraced.

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: \stupidroot 12. They can accept default parameters. 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}.