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
- Navigate to the page you want to edit.
- Click Edit.
- Click the position where you want to add LaTeX content.
- Click Insert More Content > Other Macros.
- Select the LaTeX Formatting macro from the Macro Browser.
Select your desired alignment options, or use the default settings.
Parameter Description Type Default Required Block Equation Alignment
Specify the alignment of block equations on the page
enum
center
Text Alignment
Specify the alignment of text/inline equations on the page
enum
left
Click Insert. The macro placeholder displays.
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.
- 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
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
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
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
Color formatting
Styling of LaTeX with color can be achieved by using a color parameter, e.g.
Published Result
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
Physics package
For more guidance on using this package check the package documentation.
Published Result
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.