---
title: "Document an algorithm"
canonical: "https://support.appfire.com/space/LM/96993800/Document%20an%20algorithm"
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://7659420a-c713-4736-b2e4-c8c82e68121a) |
|  |  |
| ## Step 2<br>Follow step [one](https://appfire.atlassian.net/wiki/spaces/LM/pages/96993800/Document+an+algorithm#Step-1). Create algorithm formulas in as many steps as you want. | ![image](media://7e2b4a91-9889-4b43-8c95-f4b0ee16cfe5) |
|  |  |
| ## 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://9713f8ba-0234-4336-be69-2d11e44ba36c) |
|  |  |
| ## Step 4<br>Follow step [three](https://appfire.atlassian.net/wiki/spaces/LM/pages/96993800/Document+an+algorithm#Step-3). Link the formulas in as many locations as you want. | ![image](media://d805ebe1-cbee-4299-a8a4-bb71dc757b7c) |