Block Macro
Create prominent, display-style mathematical equations that stand out from your content using the LaTeX Math Block Macro.
What is the Block Macro?
The Block Macro renders mathematical equations in display mode - centered, larger, and separated from surrounding text. Perfect for important formulas, complex equations, and multi-line mathematical expressions.
When to Use Block Macros
Use block macros when:
- ✅ Displaying important equations
- ✅ Creating multi-line mathematical expressions
- ✅ Showing complex formulas that need emphasis
- ✅ Using matrices, systems of equations, or aligned expressions
- ✅ Presenting theorems and proofs
Use inline macros instead for:
- ❌ Simple variables within text
- ❌ Short formulas in sentences
- ❌ Inline mathematical notation
How to Add a Block Macro
Method 1: Slash Command (Recommended)
- Open a Confluence page in edit mode
- Position your cursor on a new line
- Type:
/latex - Select "LaTeX Math for Confluence" or "LaTeX Math for Confluence (Block)"
- Enter your LaTeX equation
- Save the macro
Method 2: Insert Menu
- Open a page in edit mode
- Click "Insert" → "Other macros"
- Search for "latex"
- Select "LaTeX Math for Confluence"
- Click "Insert"
Writing Block Equations
Syntax Options
The block macro supports multiple LaTeX syntaxes:
Display Math Delimiters
\[
E = mc^2
\]
Double Dollar Signs
$$
E = mc^2
$$
No Delimiters (Automatic Display Mode)
E = mc^2
The macro automatically renders in display mode
LaTeX Environments
\begin{equation}
E = mc^2
\end{equation}
Alignment Options
Block macros support three alignment modes:
Center (Default)
Equations are centered on the page.
Left Align
Equations align to the left margin.
Right Align
Equations align to the right margin.
To change alignment:
- Edit the macro
- Use the alignment buttons in the preview pane
- Save changes
Examples
1. Simple Equations
LaTeX:
\[
E = mc^2
\]
Result: Energy-mass equivalence displayed prominently
2. Fractions and Roots
LaTeX:
\[
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\]
Result: The quadratic formula in display mode
3. Integrals
LaTeX:
\[
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
\]
Result: Gaussian integral
4. Summations
LaTeX:
\[
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
\]
Result: Sum of first n natural numbers
5. Matrices
LaTeX:
\[
A = \begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\]
Result: 2×2 matrix
6. Systems of Equations
LaTeX:
\[
\begin{cases}
x + y = 5 \\
2x - y = 1
\end{cases}
\]
Result: System of linear equations
7. Aligned Equations
LaTeX:
\[
\begin{align}
f(x) &= x^2 + 2x + 1 \\
&= (x + 1)^2
\end{align}
\]
Result: Multi-line aligned equation
8. Limits
LaTeX:
\[
\lim_{x \to \infty} \frac{1}{x} = 0
\]
Result: Limit notation
9. Partial Derivatives
LaTeX:
\[
\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}
\]
Result: Wave equation
10. Complex Formulas
LaTeX:
\[
\oint_C \vec{F} \cdot d\vec{r} = \iint_S (\nabla \times \vec{F}) \cdot d\vec{S}
\]
Result: Stokes' theorem
Advanced Features
Multi-line Equations
Use environments like align, gather, or multline:
\begin{align}
a^2 + b^2 &= c^2 \\
\sin^2\theta + \cos^2\theta &= 1 \\
e^{i\pi} + 1 &= 0
\end{align}
Matrices and Arrays
Multiple matrix styles are supported:
% Regular matrix
\begin{matrix}
a & b \\
c & d
\end{matrix}
% Parentheses
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
% Brackets
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
% Vertical bars (determinant)
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix}
Chemical Equations
\[
\ce{CO2 + H2O -> H2CO3}
\]
Text in Equations
\[
f(x) = \begin{cases}
x^2 & \text{if } x \geq 0 \\
-x^2 & \text{if } x < 0
\end{cases}
\]
Best Practices
✅ Do's
- Use for important equations - Make key formulas stand out
- Add spacing - Leave blank lines before/after block macros
- Organize content - Use one equation per block for clarity
- Test rendering - Preview before saving
- Use proper environments - Choose the right LaTeX environment
❌ Don'ts
- Don't overuse - Too many blocks can overwhelm readers
- Avoid inline delimiters - Don't use
$...$in block macros - Don't mix content - Keep equations separate from text
- No excessive whitespace - Clean LaTeX is better
Editing Block Macros
Edit Existing Macro
- Hover over the equation block
- Click the edit icon (⚙️)
- Modify your LaTeX in the editor
- Use Live Preview to verify changes
- Save when satisfied
Change Alignment
- Open the macro editor
- Click alignment buttons in the preview pane:
- Left align button
- Center align button
- Right align button
- Save changes
Mixed Content
You can combine text and equations in a single block:
Consider the equation:
\[
E = mc^2
\]
where $E$ is energy, $m$ is mass, and $c$ is the speed of light.
Note: Inline equations (
$...$) within block macros work as expected.
Troubleshooting
Equation Not Centering
Problem: Block equation appears left-aligned
Solution:
- Open the macro editor
- Check alignment setting in preview pane
- Select Center alignment
- Save changes
Line Breaks Not Working
Problem: Multi-line equations appear on one line
Solution:
- Use proper LaTeX environments (
align,gather) - Use
\\for line breaks within environments - Don't use
\nor\newline
Matrix Not Rendering
Problem: Matrix shows as text
Solution:
- Verify you're using
\begin{matrix}...\end{matrix} - Check for proper
\\line breaks - Use
&for column separation - Ensure balanced braces
Spacing Too Tight
Problem: Equations too close to text
Solution:
- Add blank lines before/after the macro in Confluence
- Don't add extra LaTeX spacing commands
- Let Confluence handle paragraph spacing
Performance Considerations
- ✅ Block macros handle complex equations efficiently
- ✅ Multiple blocks on one page are supported
- ⚠️ Very large matrices (>10×10) may slow rendering
- ⚠️ Limit to 20-30 block macros per page for best performance
Common Use Cases
1. Textbook Equations
Display important formulas prominently in educational content.
2. Research Documentation
Present theorems, proofs, and derivations clearly.
3. Engineering Specifications
Show calculations and formulas in technical docs.
4. Scientific Papers
Format equations according to academic standards.
5. Data Science
Display statistical formulas and models.
Related Documentation
- 📖 Inline Macro - For inline equations
- 📖 Live Preview - Real-time rendering
- 📖 LaTeX Syntax Guide
- ❓ FAQ