# UniWiki:Manual of Style/mathematics

UniWiki allows adding equations using $\LaTeX$ markup by using SimpleMathJax. Just place the expression in between  and it will be rendered.

You will be expected to learn to use Latex from other sources. This page contains only some useful information and formatting guidelines for use on this wiki.

For more in depth reading you can read the Wikipedia:Manual of Style/Mathematics. But do note that UniWiki uses different math extension than Wikipedia.

## Style

Style guidelines for math vary by location and field. Don't worry about them too much. Being consistent, unambiguous and readable is more important than strictly following guidelines.

If you have time you can read these two:

Some of the main points are listed below:

• Variables and letters that represent values should be in italic.
• Multiletter and text variables are not exactly proper thing to do but they are fine in our wiki. Generally speaking use roman letters for them.
• Text should be in roman.
• Mathematical constants should be in roman. But this is often broken (for example $e$ and $\pi$).
• Physical constants should be italic.
• Subscripts and superscripts that represent quantities should be italic. Otherwise they should be roman. For example $V_{\rm max}$ (max is roman) but $V_{n+1}$ (n is italic).
• Mathematical operators and special functions are in roman. Usually this happens automatically. For example \sin. If the special function doens't work with that then use \operatorname{}.
• Some operators will require manually setting. For example $\frac{ \mathrm{d} x }{ \mathrm{d} t}$.
• Single letter functions you define are italic. For example $f(x)$.
• Multi letter named functions are in roman. For example $\mathrm{func}(x)$.
• Units are in roman and separated from numbers by an unbreakable thin space \,. Example: $g = 9.81 \,{\rm m/s^2}$
• Do not use "*" symbol for multiplication. Use \times insted. Example: $3 \times 2 = 6$
• Equations on their own line should be indented with single ":".

## Useful $\LaTeX$ knowledge

By default the math will be in inline mode. This is good for mixing math into text. For equations that are not among text you will usually want to use display mode. This will allow the equations to gain more height.

To use display mode just add \displaystyle at the beginning of the expression.

Example:

$\sum_{k=1}^n a_k$

 \sum_{k=1}^n a_k

$\displaystyle\sum_{k=1}^n a_k$

 \displaystyle\sum_{k=1}^n a_k

Some expressions apply to the whole equation. The affected area can be limited by surrounding it with curly bracets.

Examples:

$\color{red} a = c$

 \color{red} a = c

${ \color{red} a } = c$

 { \color{red} a } = c

To write roman text instead of italic text you can use either \text{} or \rm depending on your exact needs.
\text{} will only apply to the text within curly brackets. Additionally it will make spaces visible.
\rm will change the whole equation into roman text. This will not change how spaces are removed. The area of effect can be limited by placing the expression oin curly bracets.

Examples:

$\text{This thing} = x + y$

\text{This thing} = x + y

$\rm vel = spd + d$

\rm vel = spd + dir

Normally spaces will be removed from the equation when it is rendered. Use plenty of spaces to make the latex code easier to read. If you want to keep spaces you can use the \text{} as shown above. If you just want to insert spaces into the equation you can use \  for normal space and \, for thin space.

Examples:

$abb \ b\ b\ b$ abb \ b\ b\ b
$abb \,b\,b\,b$ abb \,b\,b\,b

If you want to change the size of text in equation you can use \large, \Large or \LARGE to make it bigger. This is most useful with nested exponents and fractions. The affected area can be limited by surrounding it with curly brackets.

Example:

$a^{\frac{b}{c} }$ a^{\frac{b}{c} }
$a^{\Large \frac{b}{c} }$ a^{\Large \frac{b}{c} }

Long equations can be written on multiple lines and they will be rendered as one continuous equation. This is good for long equations that would be hard to edit otherwise.

Example:

$a+a+a+a+a+a+a+a+a+a+a+a+a+a+a + b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b$

$a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+ b+b+b+b+b+b++b+b+b+b+b++b+b+b+b+b$