LaTeX macros in Confluence come in two modes, inline and block. Choosing the wrong one is the most common reason a formula looks out of place. In Confluence Cloud, LaTeX rendering comes from a Marketplace app, so the macro isn't part of the editor itself.
What is a LaTeX macro in Confluence?
A LaTeX macro in Confluence is a placeholder you insert on a page that takes LaTeX syntax as input and renders it as a formula. You type \frac{a}{b} into the macro, save it, and the page shows the fraction. The syntax stays in the macro, so the formula remains editable later, unlike a screenshot, which must be recreated whenever an assumption changes.
When should you use inline vs. block LaTeX macros?
Use inline when the formula belongs inside a sentence, and block when it stands alone. This is the single most common source of formatting complaints, so it is worth being deliberate:
- Inline — the formula sits in the flow of text, like a variable or a short expression mentioned mid-sentence. It scales to the surrounding text size.
- Block — the formula gets its own line, usually centered, for derivations, matrices, multi-line equations, and anything with limits above and below.
Marketplace apps implement this differently, which is worth checking before you assume something is wrong with them. Some provide two separate macros, one per mode, and you pick the right one when you insert it. Others provide a single macro and let you switch between inline and block inside the editor. Either design gets you to the same place. What matters is knowing which one your app uses, because it determines where you look when a formula doesn't behave as you expected.
One example of the two-separate-macro approach is LaTeX Math for Confluence by Stiltsoft, developed by our team. It ships LaTeX Block Formulas and LaTeX Inline Formulas macros, as well as AsciiMath versions of both.
How do you insert a LaTeX macro on a Confluence page?
Here, we'll show how to insert a LaTeX macro on a Confluence page using our app, LaTeX Math for Confluence by Stiltsoft, though the process looks broadly similar in other math apps. You insert a LaTeX macro with the slash command, enter the syntax, and check the preview before saving:
- Open the page and switch to edit mode.
- Put the cursor where the formula belongs.
- Type /latex and choose the type of macro you need.
- Enter your LaTeX syntax and check the preview.
- Save.
To change a formula later, click it and choose the edit icon — the editor reopens with the syntax and a live preview.
What should you check first when a formula does not look right?
If your formula does not look right, check the macro mode first, because the two modes go wrong in opposite and recognizable ways.
- A block formula placed mid-sentence interrupts the sentence. You get a fragment of text, the formula on its own line, and the rest of the sentence continuing below it.
- An inline formula used for a display equation comes out cramped. Limits that belong above and below a summation or integral get pushed to the side, and fractions shrink to fit the line height.
Once you can tell which of the two you are looking at, the fix is the mode, not the font size or custom CSS. We've covered other possible reasons in a previous post: How do you handle LaTeX formula frame size in Confluence?
Getting the mode right fixes the layout. How cleanly the formula actually renders is down to the app, so it's worth using one whose rendering you can rely on.