More on Math Syntax

Posted by (user deleted) on 15 Oct 2008 01:06, last edited by Helmut_pdorf on 16 Oct 2008 09:13

rating: +2

# A brief tutorial on using math symbols and equations in wikidot

In the following writeup, I explain the wiki syntax for entering mathematical symbols and equations. A rudimentary knowledge of typesetting math with $\LaTeX$ will help you understand the writeup much easier.

### Inline Equations

In $\LaTeX$, in-line math commands begin and end with $. In wikidot, one enters inline math by enclosing the$\LaTeX$commands including the$ symbols with [[ and ]]. So, for example, if you want the in-line equation $\alpha + \beta = \gamma$, we would type the following: [[$\alpha + \beta = \gamma$]]. Note that in $\LaTeX$, you would type just $\alpha + \beta = \gamma$ without the double square brackets.

Alternatively, you can click on the in-line equation button in the wikidot editor to enter inline equations. When you click on this button, the editor will insert the string [[$insert LaTeX equation here$]] at the current position of the cursor. All you then have to do is replace "insert LaTeX equation here" with $\LaTeX$ commands.

### Display Math (Equations)

#### Single Line Equations

In $\LaTeX$, one can use the equation environment to display single-line equations. For example,

\begin{equation}
S_{ij,j} + \rho b_i = 0
\end{equation}


would display(1)
\begin{align} S_{ij,j} + \rho b_i = 0 \end{equation} \end{align}

Note the equation number displayed on the right. If you want to reference this number anywhere in the text, you can use the \label tag. In $\LaTeX$, you would include this in the equation environment as follows:

\begin{equation}\label{equil}
S_{ij,j} + \rho b_i = 0
\end{equation}


which would appear as(2)
\begin{align} S_{ij,j} + \rho b_i = 0 \end{align}

The equation number can now be referenced with \ref{equil} or even better, \eqref{equil}. Note that the text (tag) used to label equations (here, "equil") can be anything. Of course, for each equation, you would want to use different tags. So, suppose that we would like to reference the equation number in a follow-up text:

Note that, since $i$ is a free index, Equation \eqref{equil} represents three equations (equilibrium equations).


which would appear as "Note that, since $i$ is a free index, equation 2 represents three equations (equilibrium equations)."

In Wikidot, typing equations is made considerably simpler. The simplest way is to click on the "square root of x" button in the edit menu. This action would insert the necessary tags and all that you need to be concerned about is the $\LaTeX$ syntax for the actual equations, i.e., the stuff between the \begin{equation} and \end{equation} environment tags. Let's look at an example. In wikidot math syntax, equation 2 can be entered by first clicking on the mathematical expression button (the "square root of x" button) which would insert the following code:

[$] insert LaTeX equation here [$]


We then replace the "insert LaTeX equation here" by our equation:

[[math equil]]
S_{ij,j} + \rho b_i = 0
[[/math]]




#### Arrays

If you want to matrices to be displayed, you can use the $\LaTeX$ array environment. For example, to get

(4)
\begin{align} \left[ \begin{array}{ccc} T_{11} & T_{12} & T_{13} \\ T_{21} & T_{22} & T_{23} \\ T_{31} & T_{32} & T_{33} \end{array} \right] \end{align}

one would type

[$] \left[ \begin{array}{ccc} T_{11} & T_{12} & T_{13} \\ T_{21} & T_{22} & T_{23} \\ T_{31} & T_{32} & T_{33} \end{array} \right] [$]


Let's dissect the above code. \left[ and \right] produce the large square brackets around the matrix. The matrix contents are output using the array environment. Each matrix component is separated by & and each row is separated by \\. Each letter in {ccc} represents a column and that all the entries in each column should be centered. If you want left or right alignment for any of the columns, you would replace the corresponding c by l or r. The number of letters in braces immediately following \begin{array} represent the number of columns.

Similarly, if you want the following equation

(5)
\begin{align} \left\{ \begin{array}{c} t_1 \\ t_2 \\ t_3 \end{array} \right\} = \left[ \begin{array}{ccc} T_{11} & T_{12} & T_{13} \\ T_{21} & T_{22} & T_{23} \\ T_{31} & T_{32} & T_{33} \end{array} \right] \left\{ \begin{array}{c} n_1 \\ n_2 \\ n_3 \end{array} \right\} \end{align}

you would use the following code:

[$] \left\{ \begin{array}{c} t_1 \\ t_2 \\ t_3 \end{array} \right\} = \left[ \begin{array}{ccc} T_{11} & T_{12} & T_{13} \\ T_{21} & T_{22} & T_{23} \\ T_{31} & T_{32} & T_{33} \end{array} \right] \left\{ \begin{array}{c} n_1 \\ n_2 \\ n_3 \end{array} \right\} [$]


Note that in the above, to get curly braces, we used \left\{ and \right\} instead of \left{ and \right}. The reason for this is that { and } have special meaning in $\LaTeX$ and therefore, to typeset the braces, you have to use \{ and \}. This will allow the special meaning to be "escaped".