Inserting LaTEX mathematical formulae

SPIP has a powerful functionality that allows complex mathematical formulae to put inserted into text using the syntax defined for LaTEX.

Until 2024, SPIP itself provided this via a community server. Since 2024, you have had to use the MathJax plug-in.

For example, this functionality can allow you to show formulae like this one:

$${\displaystyle z=\left( \frac {e^{i\theta}+e^{-i\theta}}{2}\right)^2 +\left(\frac{e^{i\theta}-e^{-i\theta}}{2i} \right)^2}$$


by entering the relevant code directly into the text, just as one would with TEX.

Important note: using this method naturally requires familiarity with the formula syntax of TEX. A syntax which is not exactly straightforward... [1]

It is important to understand that in SPIP, only formulae can be converted. It is out of the question, in particular, to use any of the macro functions of TEX to affect the presentation of the page document. What is simply provided here is a tool that permits you to integrate mathematical formulae within the SPIP code as is normally performed for other SPIP objects.

SPIP-specific syntax

The SPIP syntax required consists of nesting the relevant text segment within pseudo-tags as demonstrated below:

<math>
     ...
     Put your mathematical formulae here...
     ...
</math>

As only mathematical formulas are processed, you can actually add <math>...</math> in a very broad way (in other words, you can add <math> at the very beginning of the text, and </math> at the very end...).

The only incompatibility will be if you want to display the dollar sign ($) in the text, as this symbol is used to delimit formulas (this is actually the reason for the existence of the <math></math> codes).

Within these pseudo-tags, you then need only code mathematical formulae according to the syntax of TEX, by delimiting each formula with dollars ($) or with double-dollars ($$) for a centred formula.

Here is an example

You can define complex fractions such as: ${1\over z}$, ${1\over\displaystyle 1+{1\over x}}$
You can use greek letters: $\alpha$, $\beta$, $\gamma$, $\Gamma$, $\varphi$
Present a system of equations:

$$\left\{\begin{array}{rcl} z&=&2x+3y-24\\10x+7y&=&78\\10x+5y&=&70\\\end{array}\right\}$$


and show complex formulae as centred text:

$$\left|{1\over N}\sum_{n=1}^N \gamma(u_n)-{1\over 2\pi}\int_0^{2\pi}\gamma(t){\rm d}t\right| \le {\varepsilon\over 3}.$$

which is coded as below in the original text:

<math>
You can define complex fractions such as: ${1\over z}$, ${1\over\displaystyle 1+{1\over x}}$
You can use greek letters: $\alpha$, $\beta$, $\gamma$, $\Gamma$, $\varphi$
Present a system of equations:
$$\left\{\begin{array}{rcl} z&=&2x+3y-24\\10x+7y&=&78\\10x+5y&=&70\\\end{array}\right\}$$
and show complex formulae as centred text:
$$\left|{1\over N}\sum_{n=1}^N \gamma(u_n)-{1\over 2\pi}\int_0^{2\pi}\gamma(t){\rm d}t\right| \le {\varepsilon\over 3}.$$
</math>

This system is limited to displaying well-formed mathematical formulae and no other TEX functionality is available. In particular: it is not possible to define your own macros (’\def......’ is not available) and macros other than anything specifically a mathematical formula will not be recognised. In practical usage, other limitations will be encountered, but it is important to recall that the goal of this feature is ONLY to show mathematical formulae within text, and nothing more...

Footnotes

[1wikipedia : Help:Displaying_a_formula

Author Mark Published : Updated : 18/04/24

Translations : English, français, Português do Brasil