How to Write Math Equations in Confluence
This guide provides useful tips and tricks for writing math equations in Confluence using LaTeX math syntax.
Why use LaTeX for math equations in Confluence
LaTeX is a widely used markup language for formatting mathematical and scientific content. It can be used in various types of documents, including resumes and posters, as well as books and technical documentation.
Here are the key advantages of using LaTeX for rendering math equations in Confluence:
- Precise control over equations. You can define exactly how each element of an equation appears on Confluence pages.
- Inline and block math formatting. It allows you to insert formulas directly into sentences or add them as a standalone block for better readability of complex expressions.
- Clarity. The documentation looks professional and is easy to read, understand, and review.
- Extensive symbol library. Supports the rendering of hundreds of math symbols.
How to add LaTeX to Confluence
Confluence doesn’t have native support for LaTeX syntax, so the easiest way to add math formulas to your pages is by installing an app from the Atlassian Marketplace that supports LaTeX.
One of them is LaTeX Math for Confluence. It allows you to render math formulas and equations using standard LaTeX syntax right inside your pages. Moreover, the app is built on Forge and has the Runs on Atlassian badge, meaning that no external data processing is involved, and everything stays within Atlassian’s infrastructure. This ensures maximum security and gives you full control over your content.
💡 Tip: For a quick setup, a short guide will walk through installing the app and adding your first equation in under a minute: How to add LaTeX math to Confluence.
Common LaTeX syntax for math in Confluence
With LaTeX, you can create virtually any mathematical formula. The only requirement is to know the proper LaTeX commands. Below, we’ll show some of the most commonly used commands for writing math equations in Confluence.
💡 Tip: The app LaTeX Math for Confluence has a built-in keyboard that helps you quickly find the symbols you need, even if you don’t know the exact commands.
Adding superscripts and subscripts
To insert superscripts and subscripts in Confluence, you should use the ^ and _ symbols, respectively. Here is an example:
- Subscripts: x_{index}
- Superscripts: x^{exponent}
💡 Tip: If the index or exponent consists of just one character, you can omit the curly braces to keep the script clean: x_2 or x^2.
Now let’s have a look at some popular LaTeX commands. You should use a backslash to begin each command: \command.
Fractions and roots
The most commonly used commands are for roots and fractions:
-
n-th root: \sqrt[n]{expression} (the index n is optional)
-
fraction: \frac{numerator}{denominator}
The image shows an example of how the rendered formula will look when using these LaTeX commands.
Summation and integrals
The LaTeX syntax for summations and integrals is shown in the image below. Note that these operators usually appear smaller in inline mode than in block mode.
Matrices and Vectors
If you want to add a vector with an arrow above it, you can use the \vec{} command, for instance, \vec{x} shows a vector x with an arrow on top.
For vectors in matrix form, you can use environments such as pmatrix (for parentheses) or bmatrix (for brackets). Inside these environments, the & symbol separates columns, and each row ends with \\.
So a 3×3 matrix using pmatrix might look like this:
Bracket Sizing
Small brackets around a large formula can make the whole expression look awkward and off-balance. LaTeX offers several ways to size all types of brackets properly.
To automatically size brackets for complex expressions, you can use \left( … \right) syntax. Please note that these commands must be used in pairs.
If you want more control over size, use:
-
\bigl, \Bigl, \biggl, \Biggl for the left side
-
\bigr, \Bigr, \biggr, \Biggr for the right side
This is how these sizes differ:
Spacing in formulas
Sometimes the default spacing between elements in a formula doesn’t look right. You can fine-tune spacing using several LaTeX commands:
-
To add positive space (move elements further apart), use \,(small space), \;(medium space), \quad (large space), or \qquad (extra-large space)
-
To add negative space (move elements closer together), use \!
For custom spacing, you can use \hspace{length}, which accepts both positive and negative values.
Add text to math equations
If you’d like to include a description in your formulas, use the command: \text{…}. It enables you to display parts of a formula in plain text, similar to how inline math formatting works.
You can also add the following commands to format your text:
-
Italic text: \textit{…}
-
Bold text: \textbf{…}
Multiline Equations in Confluence
When writing a series of related formulas, you can use the align environment and double backslashes \\ to separate lines. Here is an example:
This guide gathered the most common LaTeX syntax: superscripts and subscripts, roots and fractions, sums and integrals, vectors and matrices. If you need a more comprehensive list of commands, please refer to our LaTeX symbols guide.
Using these tips and the LaTeX Math for Confluence app, you’ll ensure that your equations are beautifully formatted, easy to read, and scale with your documentation needs.
👉 Try LaTeX Math for Confluence for free and bring clarity to your pages.