How to use LaTeX (math formulas / math-equations) in Confluence Cloud

Confluence_LaTeX_transparent.png

In Confluence, integrating complex formulas can be a challenge. Enter LaTeX - a simple solution for adding technical content to your pages. Here’s how to get started with LaTeX in Confluence.

📝 Note: You’ll need some previous knowledge of LaTeX. Confluence also requires a macro to convert LaTeX to HTML using MathJax. Read the MathJax documentation to learn how it works.

What is LaTeX?

LaTeX is software that’s used for formatting complex equations and formulas, and is often used in academic, scientific, and mathematical documentation.

 

Users input commands that determine the structure of the text. These commands start with a backslash and a keyword. For example, you would use “\title{This is my title}” to create a title.

How to use LaTeX in Confluence

To get started with LaTeX in Confluence, you’ll need the help of a third-party app from the Atlassian Marketplace.

 

In this article, we’ll look at two types of apps you can use: ones that only provide LaTeX formatting and ones that include a suite of other formatting macros for Confluence. 

 Choose the right app for your needs, then head back here to follow the rest of the guide.

1. On your Confluence page, click the pencil icon in the top-right to edit the page.

 

2. Type “/latex” where you’d like to add your macro, then select it from the dropdown menu.

Screenshot 2025-01-31 at 10.17.01.png

3. In the pop-up dialog, add your LaTeX equation to the “Content” section. Choose its block and inline equation alignment (left, right, center), and press “Save”.

Screenshot 2025-01-31 at 10.16.19.png

4. Click “Publish” or “Update” to view your LaTeX formula on the page.

 


LaTeX cheat sheet: How to format equations


Format inline (on the same line as other text): A single dollar sign ($) on each side of the text

 

For example:


$ax^2 + bx + c = 0$



Display as block (separate from other text): Two dollar signs ($$) on each side of the text 

 

For example:


$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$

 

Here you can see the difference, with inline formatting on the same line as the text, but with block formatting on another line:

Add colour: Add “\color{your_color}” to the beginning of your formula.

For example:

$\color{red}{ax^2 + 1 + 55 + bx + c =0}$

Creates:

Screenshot 2025-01-31 at 10.19.34.png


Format as a matrix (display numbers/symbols in rows and columns within square brackets):
 

  • Use \begin{matrix} at the beginning of the matrix

  • Add an ampersand (&) to add an extra column to your row

  • Add two forward slashes (\\) at the end of your row to add a new row

  • Use \end{bmatrix} at the end

 


For example:


\begin{bmatrix}

\alpha& \beta^{*}\\

\gamma^{*}& \delta

\end{bmatrix}

 

Creates:

Screenshot 2025-01-31 at 10.19.50.png



Format as an array (format equations in a table with each column independently aligned):

 

  • Use \begin{array}{lcl} at the beginning of the array

  • Add an ampersand (&) to skip/move to the next column in your table

  • Add two forward slashes (\\) at the end of your row to add a new row

  • Use \end{array} at the end

 

For example:

 

\begin{array}{lcl}

z & = & a \\

& = & a \\

f(x,y,z) & = & x + y + z

\end{array}

 

Creates:

 

Screenshot 2025-01-31 at 10.20.03.png


What formatting tips do you have for academic and scientific content in Confluence? Share with us below! 👇

 

4 comments

Comment

Log in or Sign up to comment
Andrei Stebakov October 4, 2024

Inline formatting is broken in the latest Cloud Confluence. Inline is treated as block.

Keyuan Bo January 22, 2025

Hi,

I have one question, if we use these macros to generate a formula, how can I export these formulas when I would like to print the page in a pdf or word format?

The output shows "Content Formatting Macros for Confluence cannot be exported to PDF".

Thanks,

Like Jason Wallace likes this
Nar Kumar C_ - Narva Software
Atlassian Partner
January 22, 2025

Just want to mention that there are multiple apps on the Marketplace and you might want to try them before deciding which one to keep, depending on your requirements.

I believe, our app:

LaTeX Math for Confluence - Math Formula & Equations 

is a very good one (if not the best 😉), both feature and cost wise. But I might be a bit biased as it is developed by the team I belong.

Abi Brown- Kolekti
Atlassian Partner
January 22, 2025

Hi Keyuan Bo

PDF exporting is on our roadmap, currently we do have limitations on export. You can use browser print copy if this will help? I am the customer success manager for Content formatting macros of which LaTeX is one of our macros, so if you want to discuss further please do reach out as happy to chat and keep you in the loop - email is abrown@kolekti.com 

Thanks

Abi 

Senior Customer Success manager  

Like Jason Wallace likes this
TAGS
AUG Leaders

Atlassian Community Events