LaTeX Formatting

The LaTeX Formatting macro can be used to convert LaTeX (a document preparation system) mathematical language to HTML. This can be useful for displaying mathematical/scientific equations on a page, or formatting in a certain style.

This macro requires some previous knowledge of using LaTeX and LaTeX Mathematics. It may also be useful to review the documentation for MathJax, which enables the conversion between LaTeX and HTML and provides a range of informative examples on using the language.

Instructions

  1. Navigate to the page you want to edit.
  2. Click  Edit.
  3. Click the position where you want to add LaTeX content.
  4. Click Insert More Content  Other Macros.
  5. Select the  LaTeX Formatting macro from the Macro Browser.
  6. Select your desired alignment options, or use the default settings.

    ParameterDescriptionTypeDefaultRequired

    Block Equation Alignment

    Specify the alignment of block equations on the page

    enum

    center

    (error)

    Text Alignment

    Specify the alignment of text/inline equations on the page

    enum

    left

    (error)

  7. Click Insert. The macro placeholder displays.

  8. Enter the mathematical LaTeX inside the macro body. Multiple LaTeX formulae or equations can be included inside a single macro, and multiple macros can be included within a page.

  9. Save the page to view the rendered LaTeX formatting.

Due to a Confluence limitation, the Export to PDF functionality does not work for content created with the LaTex Formatting macro. If you want to preserve your content in PDF format, we recommend that you use your browser’s built-in functionality to print to PDF.

Block vs inline formatting

There are two ways in which LaTeX can be displayed on the page using this macro: Block  and  Inline

Inline

To display an Inline equation, a single dollar sign must be placed on either side of the LaTeX within the macro,

Published Result

Displaying an inline equation will look like this: $ax^2 bx +c =0$

Block

To display a block equation, a double dollar sign must be placed either side of the LaTeX within the macro, e.g.

Published Result

Displaying a block equation will look like this $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$

Examples

Matrix and array

You can use an array to format equations similar to the following example.

text
\begin{array}{lcl} z & = & a \\ & = & a \\ f(x,y,z) & = & x + y + z \end{array}

Published Result

\begin{array}{lcl} z & = & a \\ & = & a \\ f(x,y,z) & = & x + y + z \end{array}


A matrix can be applied to arrange a formula in columns with different delimiters such as the centred bracketed matrix below.

text
\begin{bmatrix} \alpha& \beta^{*}\\ \gamma^{*}& \delta \end{bmatrix}

Published Result

\begin{bmatrix} \alpha& \beta^{*}\\ \gamma^{*}& \delta \end{bmatrix}

Color formatting

Styling of LaTeX with color can be achieved by using a color parameter, e.g. 

Published Result

This equation will display in "red": $\color{red}{ax^2 + 1 + 55 + bx + c =0}$

Packages

To provide extra functionality for the LaTeX Formatting macro, a number of LaTeX packages have been included. These include  mhChem, and  Physics.

mhChem package

For more guidance on using this package check the package documentation.

Published Result

Using the mChem package, this equation will be displayed as follows: $\ce{CO2 + C -> 2 CO}$

Physics package

For more guidance on using this package check the package documentation.

Published Result

Using the Physics package, this equation will be displayed as follows: $\dv{f}{x}$

Export LaTeX to PDF

Due to a Confluence limitation, the Export to PDF functionality does not work for content created with the LaTeX macros. If you want to preserve your content in PDF format, we recommend that you use your browser’s built-in functionality to print to PDF.


If you are still stuck please contact our support team who can offer you more assistance. 
You can try our full range of content formatting macros for free by visiting the Marketplace.
On this page