# LaTeX macros

Our LaTeX macros support LaTeX as well as mhchem.

There are 2 LaTeX macros available:

• LaTeX (Block) for block level equations

• LaTeX (Inline) for inline equations

These macros are only available in the commercial cloud version of the app – available December 2023.

## How to Use

1. In the Confluence editor, type /latex and select LaTeX (Block) or LaTeX (Inline).

2. Add your LaTeX formula or chemical equation in mhchem format into the macro body screen.

3. Save the Confluence page.

Your mathematical formula or chemical equation will be displayed.

## Example syntax

### Mathematics – LaTeX syntax

##### Example 1 - Pythagorean theorem

Macro body

CODE
x^2 + y^2 = z^2

Output:

##### Example 2 - Mass-energy equivalence

Macro body

CODE
E=mc^2

Output:

##### Example 2 - Binomial coefficient

Macro body:

CODE
\binom{n}{k} = \frac{n!}{k!(n-k)!}

Output:

##### Example 4 - Reference

Description

Syntax

Output

Greek letters

\alpha \beta \gamma \rho \sigma \delta \epsilon

Binary operators

\times \otimes \oplus \cup \cap

Relation operators

< > \subset \supset \subseteq \supseteq

Others

\int \oint \sum \prod

### Chemistry – mhchem syntax

Comprehensive mhchem syntax documentation is available here.

#### Chemical equations

##### Example 1.

Macro body:

CODE
\ce{CO2 + C -> 2 CO}

Output:

##### Example 2.

Macro body:

CODE
\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}

Output:

#### Chemical formulae

##### Example 1.

Macro body:

CODE
\ce{H2O}

Output:

##### Example 2.

Macro body:

CODE
\ce{Sb2O3}

Output:

##### Example 1.

Macro body:

CODE
\ce{CrO4^2-}

Output:

##### Example 2.

Macro body:

CODE
[AgCl2]-

Output:

#### Nuclides, isotopes

##### Example 1.

Macro body:

CODE
\ce{^{227}_{90}Th+}

or

CODE
\ce{^227_90Th+}

Output:

##### Example 2.

Macro body:

CODE
\ce{^{0}_{-1}n^{-}}

or

CODE
\ce{^0_-1n-}

Output:

It might be ambiguous whether a superscript belongs to the left or right element. There is automatic detection (digits only = mass number = belongs to right side), but to make sure you can type {} as a separator.

##### Example 3.

Macro body:

CODE
\ce{H{}^3HO}

or

CODE
\ce{H^3HO}

Output:

#### Reaction arrows

##### Example 1.

Macro body:

CODE
\ce{A -> B}

Output:

##### Example 2.

Macro body:

CODE
\ce{A <- B}

Output:

##### Example 3.

Macro body:

CODE
\ce{A <-> B}

Output:

Not to be used according to IUPAC and ACS

##### Example 4.

Macro body:

CODE
\ce{A <--> B}

Output:

##### Example 5.

Macro body:

CODE
\ce{A <=> B}

Output:

##### Example 6.

Macro body:

CODE
\ce{A <=>> B}

Output:

##### Example 7.

Macro body:

CODE
\ce{A <<=> B}

Output:

Each arrow can take two optional arguments: one for above and one for below. The arrow arguments use the same input syntax as the \ce command.

##### Example 8.

Macro body:

CODE
\ce{A ->[H2O] B}

Output:

##### Example 9.

Macro body:

CODE
\ce{A ->[{text above}][{text below}] B}

Output:

##### Example 10.

Macro body:

CODE
\ce{A ->[$x$][$x_i$] B}

Output:

#### Parentheses, brackets, braces

Use parentheses ( ) and brackets [ ] normally. Write braces as \{ \}.

##### Example 1.

Macro body:

CODE
\ce{(NH4)2S}

Output:

##### Example 2.

Macro body:

CODE
\ce{[\{(X2)3\}2]^3+}

Output:

For large parentheses, \left and \right macros need to be in the same math environment, so you might have to put \ce into $ into \ce, but that’s fine. ##### Example 3. Macro body: CODE \ce{CH4 + 2$\left( \ce{O2 + 79/21 N2} \right)\$}

Output:

JavaScript errors detected