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:
![\phi](http://chart.googleapis.com/chart?cht=tx&chl=%5Cphi)
,
![\pi](http://chart.googleapis.com/chart?cht=tx&chl=%5Cpi)
,
![\Xi](http://chart.googleapis.com/chart?cht=tx&chl=%5CXi)
. eLyXer offers a complete set in both upper case:
![\Gamma\ldots\Omega](http://chart.googleapis.com/chart?cht=tx&chl=%5CGamma%5Cldots%5COmega)
and lower case:
![\alpha\ldots\omega](http://chart.googleapis.com/chart?cht=tx&chl=%5Calpha%5Cldots%5Comega)
. Also the AMS italicized upper case:
![\varGamma\ldots\varOmega](http://chart.googleapis.com/chart?cht=tx&chl=%5CvarGamma%5Cldots%5CvarOmega)
.
2.2 Math Symbols
2.3 Other Symbols
There are other symbols like arrows:
![\leftarrow\rightarrow](http://chart.googleapis.com/chart?cht=tx&chl=%5Cleftarrow%5Crightarrow)
, or geometrical shapes:
![\circ](http://chart.googleapis.com/chart?cht=tx&chl=%5Ccirc)
,
![\square](http://chart.googleapis.com/chart?cht=tx&chl=%5Csquare)
. eLyXer offers limited support for them. You might also want to use financial symbols in formulae:
![\yen\euro\$](http://chart.googleapis.com/chart?cht=tx&chl=%5Cyen%5Ceuro%5C%24)
.
2.4 Spacing
The command
\raisebox is useful to, surprisingly, raise a little box,
Like
\mbox, it puts its content in a text box. It can also be used just for spacing:
![\raisebox{5mm}{}B^{V}](http://chart.googleapis.com/chart?cht=tx&chl=%5Craisebox%7B5mm%7D%7B%7DB%5E%7BV%7D)
.
There are other spacing commands:
\hspace:
![a\hspace{4mm}b](http://chart.googleapis.com/chart?cht=tx&chl=a%5Chspace%7B4mm%7Db)
, protected space:
![a\ b](http://chart.googleapis.com/chart?cht=tx&chl=a%5C+b)
, and (at “block level”)
\vspace:
![a\vspace{1cm}b](http://chart.googleapis.com/chart?cht=tx&chl=a%5Cvspace%7B1cm%7Db)
.
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,
![\alpha x+\alpha y=\alpha(x+y)](http://chart.googleapis.com/chart?cht=tx&chl=%5Calpha+x%2B%5Calpha+y%3D%5Calpha%28x%2By%29)
, with the exception of upright capital Greek letters,
![G\ne\Gamma](http://chart.googleapis.com/chart?cht=tx&chl=G%5Cne%5CGamma)
.
Function names should be upright:
![\sin(2\pi),\log(x),\tan\delta](http://chart.googleapis.com/chart?cht=tx&chl=%5Csin%282%5Cpi%29%2C%5Clog%28x%29%2C%5Ctan%5Cdelta)
.
Mathematical fonts used in equations include
![\mathrm{Roman}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathrm%7BRoman%7D)
(
\mathrm),
![\mathsf{Sans\: Serif}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathsf%7BSans%5C%3A+Serif%7D)
(
\mathsf),
![\mathtt{Typewriter}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathtt%7BTypewriter%7D)
(
\mathtt),
![\mathbf{Bold}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathbf%7BBold%7D)
(
\mathbf),
![\mathscr{SCRIPT}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathscr%7BSCRIPT%7D)
(
\mathscr),
![\mathcal{CALLIGRAPHIC}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathcal%7BCALLIGRAPHIC%7D)
(
\mathcal),
![\mathbb{BLACKBOARD\: BOLD}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathbb%7BBLACKBOARD%5C%3A+BOLD%7D)
(
\mathbb), and
![\mathfrak{Fraktur}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathfrak%7BFraktur%7D)
(
\mathfrak). For the latter, some single characters are translated to their Unicode equivalents:
![\mathscr{F}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathscr%7BF%7D)
,
![\mathbb{F}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathbb%7BF%7D)
,
![\mathfrak{F}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmathfrak%7BF%7D)
.
Regular text in a formula can be achieved via text font commands like
\textrm:
![5\:\textrm{to}\:10](http://chart.googleapis.com/chart?cht=tx&chl=5%5C%3A%5Ctextrm%7Bto%7D%5C%3A10)
, via boxes like \mbox (prevents line breaks):
![6\mbox{ is more than }5](http://chart.googleapis.com/chart?cht=tx&chl=6%5Cmbox%7B+is+more+than+%7D5)
, or the AMSmath
\text macro (scales like math symbols)
![\text{base}_{\text{sub}}^{\text{super}}](http://chart.googleapis.com/chart?cht=tx&chl=%5Ctext%7Bbase%7D_%7B%5Ctext%7Bsub%7D%7D%5E%7B%5Ctext%7Bsuper%7D%7D)
. 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}}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cmbox%7B%5Ctextbf%7B%5Ctextsf%7B%5Ctextbf%7B%5Ctextit%7Bsfbfit%7D%7D%7D%7D%2C+%5Ctextipa%7Btipa%7D%7D)
.
Units should be written upright, either with
\mathrm or with macros from the
units package, e.g. as simple unit,
![\unit{km}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cunit%7Bkm%7D)
, with magnitude,
![\unit[57]{km}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cunit%5B57%5D%7Bkm%7D)
, with fractional unit,
![\unitfrac[200]{km}{h}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cunitfrac%5B200%5D%7Bkm%7D%7Bh%7D)
, or with a fraction before the units,
![\unit[\nicefrac{3}{2}]{km}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cunit%5B%5Cnicefrac%7B3%7D%7B2%7D%5D%7Bkm%7D)
,
![\unit[\frac{7}{16}]{s}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cunit%5B%5Cfrac%7B7%7D%7B16%7D%5D%7Bs%7D)
.
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:
A big recursive fraction:
A nice fraction:
![\nicefrac{5}{6}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cnicefrac%7B5%7D%7B6%7D)
. A non-diminishing fraction containing alignments:
A similar concept is a binomial coefficient:
![\binom{A+1}{B}.](http://chart.googleapis.com/chart?cht=tx&chl=%5Cbinom%7BA%2B1%7D%7BB%7D.)
It can be prettily presented:
A symbol can be stacked over another using
\stackrel:
![x\stackrel{R}{\rightarrow}y](http://chart.googleapis.com/chart?cht=tx&chl=x%5Cstackrel%7BR%7D%7B%5Crightarrow%7Dy)
. Anything can be stacked:
4.2 Limits
![\lim_{x\rightarrow\infty}f(x)](http://chart.googleapis.com/chart?cht=tx&chl=%5Clim_%7Bx%5Crightarrow%5Cinfty%7Df%28x%29)
should appear as
![x\rightarrow\infty](http://chart.googleapis.com/chart?cht=tx&chl=x%5Crightarrow%5Cinfty)
in italics, and «lim» in plain style. In display mode, a limit must appear below the main symbol:
Limits are also used in sums and integrals:
where the sum’s limits should appear below (
![i=1](http://chart.googleapis.com/chart?cht=tx&chl=i%3D1)
) and above (
![\infty](http://chart.googleapis.com/chart?cht=tx&chl=%5Cinfty)
) the
![\sum](http://chart.googleapis.com/chart?cht=tx&chl=%5Csum)
. The placement of the integral limits depends on the document class: LaTeX standard classes place them right to the
![\int](http://chart.googleapis.com/chart?cht=tx&chl=%5Cint)
. Limits are shown to the right in inline formulae:
![\sum_{i=1}^{\infty}x](http://chart.googleapis.com/chart?cht=tx&chl=%5Csum_%7Bi%3D1%7D%5E%7B%5Cinfty%7Dx)
and
The placing of limits can be configured with the
\limits and
\nolimits macros:
A square root:
![\sqrt{3}.](http://chart.googleapis.com/chart?cht=tx&chl=%5Csqrt%7B3%7D.)
A more complex root in a fraction:
eLyXer can also do higher-order roots:
![\sqrt[3]{x+y}](http://chart.googleapis.com/chart?cht=tx&chl=%5Csqrt%5B3%5D%7Bx%2By%7D)
. 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]](http://chart.googleapis.com/chart?cht=tx&chl=%5Cleft%5B%5Cbegin%7Barray%7D%7Bcc%7D%0Aa+%26+b%5C%5C%0Ac+%26+d%5Cend%7Barray%7D%5Cright%5D)
is always shown in the same line. In display mode, the array is shown on its own line:
Apart from that the appearance should be the same.
5.2 Brackets
Used to switch between several values.
Cases may have more than two rows:
5.4 Braces
Values can be underbraced or overbraced.
![\underbrace{a-b}=\overbrace{b+c+d+e}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cunderbrace%7Ba-b%7D%3D%5Coverbrace%7Bb%2Bc%2Bd%2Be%7D)
.
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](http://chart.googleapis.com/chart?cht=tx&chl=%5Cstupidroot+12)
. They can accept default parameters. Again, useful in formulae:
![\defaultroot](http://chart.googleapis.com/chart?cht=tx&chl=%5Cdefaultroot)
.
Other definitions from the preamble can be used:
![\preambleroot{3}{4}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cpreambleroot%7B3%7D%7B4%7D)
.
Definitions on the fly are also possible:
![\newcommand{\ontheflyroot}[2]{\sqrt[#1]{#2}}\ontheflyroot{7}{8}](http://chart.googleapis.com/chart?cht=tx&chl=%5Cnewcommand%7B%5Contheflyroot%7D%5B2%5D%7B%5Csqrt%5B%231%5D%7B%232%7D%7D%5Contheflyroot%7B7%7D%7B8%7D)
, and used with different values:
![\ontheflyroot{a}{b}](http://chart.googleapis.com/chart?cht=tx&chl=%5Contheflyroot%7Ba%7D%7Bb%7D)
.