---
title: "Document an algorithm"
canonical: "https://support.appfire.com/space/LMDC/3882978004/Document+an+algorithm"
format: markdown
---
> Macro (aura-html)

# Scenario

Create an algorithm using* LaTeX Math* features.

## Steps

The following steps demonstrate how to create a math algorithm using the *LaTeX Math Block* macro and *LaTeX Math Block Reference *macro features:

|  |  |
| --- | --- |
| ## Step 1<br>**Create an equation**<br>1. Navigate to the project page and click edit.
2. Go to the content where you need to insert the formula.
3. Type ‘/' and search for the *LaTeX Math Block* macro or use the '+’ option in the main toolbar and search for the *LaTeX Math Block* macro.
4. Select the *LaTeX Math Block *macro.
5. Type the equation in LaTeX formatted math. A preview is generated.
6. Specify an anchor. By specifying the anchor you can refer equation on a different page or the same page.
7. Click **Insert**.<br>> ⚠️ Specify the right names for each of the anchor that is created across the page so that you can reference them on a different page or the same page. | ![Specify the right names for each of the anchor that is created across the page so that you can reference them on a](media://c931747a-6273-4085-881a-8d3e66a8d19f) |
|  |  |
| ## Step 2<br>Follow step [one](https://appfire.atlassian.net/wiki/spaces/LMDC/pages/3882978004/Document+an+algorithm#Step-1). Create algorithm formulas in as many steps as you want. | ![image](media://bd21c401-fc6c-460c-9393-52d025b719a8) |
|  |  |
| ## Step 3<br>**Link the equation**<br>Add the* LaTeX Math Block Reference* macros to refer to the formula on the different page(s):<br>1. Navigate to where you want to refer to the formula.
2. Type* ‘/' *and search* *for* the LaTeX Math Block* *Reference* macro or use the '+’ option in the editor’s main toolbar and search for the *LaTeX Math Block* *Reference* macro.
3. Select the *LaTeX Math Block Reference *macro.
4. Specify the anchor of the equation that you mentioned earlier in step one.  
[NOTE] You must remember the anchor of the equation. Make sure you mention the relevant anchor name so you can refer to them whenever required.
5. Select the *Confluence page*. In this example, we refer to the formula from the same page, hence we leave the parameter blank.
6. The reference link is automatically created. | ![The reference link is automatically created](media://9304f6c1-316a-470a-a8c9-0e0a2df5c797) |
|  |  |
| ## Step 4<br>Follow step [three](https://appfire.atlassian.net/wiki/spaces/LMDC/pages/3882978004/Document+an+algorithm#Step-3). Link the formulas in as many locations as you want. | ![image](media://4b8deebc-0247-4f86-9d27-84d5d4df3786) |