MathBlock LaTeX

MathBlock LaTeX for Confluence

MathBlock adds two macros to Confluence Cloud. Math block puts a LaTeX formula on its own line, and Inline math puts a small one inside a sentence. Both are drawn as SVG pictures by MathJax 3.2.2 running inside the app on Atlassian's servers, so no formula ever leaves Atlassian.

It's built around two things people complain about in the older LaTeX apps, dark mode and PDF export. Formulas are coloured for Confluence's light or dark theme. When a page is exported, the app hands Confluence a static picture of each block formula, or its LaTeX source if you'd rather have that.

What you get

Math block (LaTeX) is for display formulas, centred or left-aligned, with equation numbers from \tag{}. Inline math (LaTeX) is for formulas inside a line of text, and hovering over one shows its source. Both come in four sizes (Small, Normal, Large, Extra large).

How to use it

Type / in the editor, search for Math block or Inline math, and insert it. The settings panel opens. Type the LaTeX without dollar signs, as in this example.

\int_0^1 x^2 \, dx = \frac{1}{3}

Block formulas have two more settings. Alignment is Centre or Left. "In PDF and Word export" is either a picture of the formula (the default) or the LaTeX source as text.

Supported LaTeX

MathBlock loads the MathJax TeX packages base, ams, amscd, bbox, boldsymbol, braket, cancel, cases, centernot, color, colortbl, configmacros, empheq, enclose, extpfeil, gensymb, mathtools, mhchem (\ce{} chemistry), newcommand, tagformat, textcomp, textmacros, unicode, upgreek and verb. bussproofs (proof trees) and the physics package aren't included.

A few things behave differently from a full LaTeX install.

Equations are numbered only by \tag{}. The align, gather and equation environments don't number themselves, because each macro is drawn on its own and the numbers would restart at (1) in every macro. \ref and \eqref aren't supported and show (???).

Exporting pages

When Confluence exports a page, it asks the app for each macro.

If an export shows an empty frame where a block formula should be, switch that block to "LaTeX source as text" and tell us which export you used (see Support).

Limits

LimitValue
Formula length4,000 characters, where emoji and letters like 𝑥 count as two
Drawing size400 KB of SVG. Very long formulas can hit this before the length limit, and you get an error that says so
Picture size2,400 px on the longer side; larger formulas are scaled down. If that would leave a formula under 8 px tall (it's more than 300 times wider than it is tall), you get an error asking you to break it across lines
SizesSmall 0.85×, Normal 1×, Large 1.3×, Extra large 1.7×
Macro expansion2,000 substitutions and 20,000 characters, so a self-referencing \def stops with an error
Formulas per pageNo set limit. Each formula is drawn by its own call to the app when the page opens, and pages with hundreds of formulas haven't been tested yet

Inline formulas are pictures, and the app can't shift a picture below the text baseline the way MathJax does on a web page. So a formula that dips below the line, like one with a subscript or a fraction, can sit a little higher than the words around it.

Privacy and security

The app asks for no Confluence permissions (its scope list is empty), stores nothing, and makes no outside network calls. The LaTeX you type is saved by Confluence as part of the macro, like any other macro setting. The app's function reads it when the page is viewed or exported, draws it, and keeps the drawing (or the error) in memory for a short time so repeat views are quicker. See PRIVACY.md.

Support

Use the support link on the Marketplace listing. Please include the formula and, for errors, the line and column MathBlock showed.

Support Zovo

Zovo builds and maintains this app. If it saves you time, you can support the work on GitHub Sponsors. Sponsorship is optional, and the tool works the same without it.

Zovo is made by theluckystrike on GitHub.

More tools by Zovo

Licence

The app is MIT licensed (LICENSE). It bundles MathJax 3.2.2, which is Apache-2.0 licensed.

Support this work

If this app saves you time, you can support the work on GitHub Sponsors. Monthly tiers start at $5, and one-time tiers start at $15. Sponsorship is optional, and the tool works the same without it.

Sponsor on GitHubZovo on GitHub