Skip to main content
Kolekti home
How to format equations and formulas with LaTeX in Confluence Cloud
Share on socials

How to format equations and formulas with LaTeX in Confluence Cloud

A headshot of Holly Aspinall
Holly Aspinall
24 January 2024
1 min read
A Confluence page filled with colourful LaTeX equations
A headshot of Holly Aspinall
Holly Aspinall
24 January 2024
1 min read
Jump to section
What is LaTeX?
Why add LaTeX to a Confluence page?
How to add LaTeX to Confluence
Get more out of LaTeX in Confluence: formatting options

Adding LaTeX formulas to your documentation has never been easier! Here’s how to quickly format LaTeX in Confluence.

In Confluence, expressing complex formulas or ensuring consistent formatting can be tricky. Enter LaTeX - an easier way to integrate technical content on your pages. Discover how to easily add LaTeX in Confluence with our handy guide.
Looking for other ways to boost your documentation? Read our guide and tips on how to effectively use Confluence for documentation.

Note: You’ll need some previous knowledge of LaTeX in order to use it in Confluence. Furthermore, Confluence requires a macro that converts LaTeX to HTML using MathJax. You may also want to read the MathJax documentation to better understand how it works.

What is LaTeX?

LaTeX is a typesetting system that’s able to handle complex equations and structures. It’s most often used when creating scientific and mathematical documents.

Users input plain text alongside commands that indicate the structure and formatting of the text. The commands begin with a backslash and a keyword, followed by your content within curly brackets. For example, to create a title, you would use “\title{This is my title}”.

Why add LaTeX to a Confluence page?

Because it’s so highly technical, LaTeX might not be right for everyone’s Confluence needs. However, there are many contexts where this typesetting system is crucial. If your Confluence pages contain scientific, mathematical, or highly technical content, you’ll likely find LaTeX formatting invaluable.

How to add LaTeX to Confluence

To add LaTeX to Confluence, you’ll need an extra app to help you. You have two options:
  • LaTeX for Confluence: a standalone macro that unlocks LaTeX formatting within Confluence.
  • Content Formatting Macros for Confluence: a complete macro toolkit that includes LaTeX for Confluence plus many other macros to format and structure your pages, including BibTeX, footnotes, and tooltips.
Unsure which app to get? Try both free for 30 days to help you make your choice.
1. Head to your chosen Confluence page and click the pencil icon (or press “E” on your keyboard) to start editing.
A Confluence page with a cursor hovering over the page Edit icon
2. Type “/latex” on the page and select the LaTeX macro in the dropdown menu.
A user typing the LaTeX for Confluence macro shortcut on a page
3. In the pop-up dialog, add your LaTeX to the “Content” section and format its alignment, and press “Save”.
The LaTeX for Confluence editor showing equations highlighted in red and blue
4. Click “Publish” (or “Update”, if it’s an existing page) to see your new LaTeX formula on your page.
A published Confluence page featuring LaTeX formulas highlighted in red and blue

Get more out of LaTeX in Confluence: formatting options

Inline vs block formatting

To display an equation inline (on the same line as any other text), place a single dollar sign on either side of the text:
$ax^2 + bx + c = 0$
To display an equation as a block (separately on its own), place two dollar signs on either side of the text:
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
Here’s a comparison of what they look like side-by-side:
A LaTeX formula formatted inline, beside a LaTeX formula formatted as a block

Add colour to LaTeX formulas

Want to make your LaTeX formatting stand out? Add the “\color{your_color}” parameter at the beginning of your text. For example:
$\color{red}{ax^2 + 1 + 55 + bx + c =0}$

This will display as:
A LaTeX formula with red text

Formatting as a matrix and an array


Matrix

Display numbers or symbols in rows and columns to represent a mathematical object or one of its properties. Here’s an example:
\begin{bmatrix}
\alpha& \beta^{*}\\
\gamma^{*}& \delta
\end{bmatrix}

This will display as:
Scientific LaTeX symbols displayed in two columns as a matrix within square brackets

Array


Format equations in a table with the ability to left, centre, or right align elements in each column. For example:
\begin{array}{lcl}
z & = & a \\
& = & a \\
f(x,y,z) & = & x + y + z
\end{array}

This will display as:
Three rows of mathematical equations formatted in an array using LaTeX

Integrated packages

LaTex for Confluence comes with additional packages included for even more functionality. Users can take advantage of the Unit, mhChem, and Physics packages, which are especially helpful for scientific and academic work.

Unit
Add units such as angles to your LaTeX formatting. Learn more about what units you can use with the siunitx LaTeX documentation.
The LaTeX for Confluence editor with various units of measurement in the text box

mhChem

Easily typeset chemical molecular equations and formulae. Explore the mhChem LaTeX package documentation for more information.
The LaTeX for Confluence editor with a molecular equation in the text box

Physics

Quickly and easily format physics equations such as the Cauchy principal value (shown below). Read the LaTeX physics package documentation to learn more.
The LaTeX for Confluence editor with the Cauchy principal value in the text box
Want to enhance your documentation with LaTeX, BibTeX, references, and more? Discover the power of Content Formatting Macros for Confluence.
Written by
A headshot of Holly Aspinall
Holly Aspinall
Content Marketing Manager
As an experienced Content Marketing Manager, Holly is dedicated to writing valuable, accessible guides that help users understand their tools better and get more out of their workday.

LinkedIn →