David Simpson Apps

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).Confluence editor showing /latex macro selection for LaTeX (Block) and 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

x^2 + y^2 = z^2

Output:

LaTeX rendered output of Pythagorean theorem: x² + y² = z²Example 2 - Mass-energy equivalence Macro body

E=mc^2

Output:

LaTeX rendered output of mass-energy equivalence: E=mc²Example 2 - Binomial coefficient Macro body:

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

Output:

LaTeX rendered output of binomial coefficient formulaExample 4 - Reference

DescriptionSyntaxOutput
Greek letters\alpha \beta \gamma \rho \sigma \delta \epsilonLaTeX rendered Greek letters: α β γ ρ σ δ ε
Binary operators\times \otimes \oplus \cup \capLaTeX rendered binary operators: × ⊗ ⊕ ∪ ∩
Relation operators\subset \supset \subseteq \supseteqLaTeX rendered relation operators: ⊂ ⊃ ⊆ ⊇
Others\int \oint \sum \prodLaTeX rendered symbols: ∫ ∮ Σ Π

Chemistry – mhchem syntax

Comprehensive mhchem syntax documentation is available here .

Chemical equations

Example 1. Macro body:

\ce{CO2 + C -> 2 CO}

Output:

mhchem rendered chemical equation: CO₂ + C → 2COExample 2. Macro body:

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

Output:

mhchem rendered chemical equation: mercury ion complexation with iodide

Chemical formulae

Example 1. Macro body:

\ce{H2O}

Output:

mhchem rendered chemical formula: H₂OExample 2. Macro body:

\ce{Sb2O3}

Output:

mhchem rendered chemical formula: Sb₂O₃ChargesExample 1. Macro body:

\ce{CrO4^2-}

Output:

mhchem rendered charged species: CrO₄²⁻Example 2. Macro body:

[AgCl2]-

Output:

mhchem rendered charged species: [AgCl₂]⁻

Nuclides, isotopes

Example 1. Macro body:

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

or

\ce{^227_90Th+}

Output:

mhchem rendered nuclide notation: ²²⁷₉₀Th⁺Example 2. Macro body:

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

or

\ce{^0_-1n-}

Output:

mhchem rendered nuclide notation: ⁰₋₁n⁻

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:

\ce{H{}^3HO}

or

\ce{H^3HO}

Output:

mhchem rendered isotope: H³HO

Reaction arrows

Example 1. Macro body:

\ce{A -> B}

Output:

mhchem rendered forward reaction arrow: A → B

Example 2. Macro body:

\ce{A <- B}

Output:

mhchem rendered backward reaction arrow: A ← B

Example 3. Macro body:

\ce{A <-> B}

Output:

mhchem rendered reversible reaction arrow: A ↔ B

Not to be used according to IUPAC and ACS

Example 4. Macro body:

\ce{A <--> B}

Output:

mhchem rendered double equilibrium arrow: A ⟵⟶ B

Example 5. Macro body:

\ce{A <=> B}

Output:

mhchem rendered equilibrium arrow: A ⇌ B

Example 6. Macro body:

\ce{A <=>> B}

Output:

mhchem rendered fast-forward equilibrium arrow: A ⇌≫ B

Example 7. Macro body:

\ce{A <<=> B}

Output:

mhchem rendered fast-backward equilibrium arrow: A ≪⇌ B

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:

\ce{A ->[H2O] B}

Output:

mhchem rendered labelled reaction arrow: A →[H₂O] BExample 9. Macro body:

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

Output:

mhchem rendered labelled reaction arrow with text above and belowExample 10. Macro body:

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

Output:

mhchem rendered labelled reaction arrow with mathematical labels x and xᵢ

Parentheses, brackets, braces

Use parentheses ( ) and brackets [ ] normally. Write braces as \{ \}. Example 1. Macro body:

\ce{(NH4)2S}

Output:

mhchem rendered chemical formula with parentheses: (NH₄)₂SExample 2. Macro body:

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

Output:

mhchem rendered chemical formula with nested brackets and braces: [{(X₂)₃}₂]³⁺

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:

\ce{CH4 + 2 $\left( \ce{O2 + 79/21 N2} \right)$}

Output:

mhchem rendered chemical formula with large parentheses: CH₄ with oxygen and nitrogen