Add code, equations and Mermaid diagrams in Notes
Add code blocks with syntax highlighting, LaTeX equations and Mermaid diagrams to a Foxcolab Notes page, and see how each one looks in exports and published pages.
Updated 2 min read
In short
In Foxcolab Notes, type /Code for a code block with syntax highlighting, /Block equation or /Inline equation for LaTeX math, and /Mermaid diagram to draw a chart from text. Pick the code language from the label on the block. Equations come out as math in HTML, PDF and published pages and as LaTeX in Markdown. Mermaid diagrams export as their source text.
Key takeaways
- Type / and choose Code, or type three backticks and a space, for a code block.
- Click the language label on a code block to pick one of 38 languages, or Plain text.
- Block equation and Inline equation take LaTeX. Typing $$ and a space, or $x^2$, works too.
- Mermaid diagram draws a flowchart or other chart below the text that describes it.
- Exports keep code and equations. Mermaid diagrams export as their text, not as a picture.
Last reviewed 4 December 2026
Foxcolab Notes has three blocks for technical writing: Code for snippets with syntax highlighting, Block equation and Inline equation for math written in LaTeX, and Mermaid diagram for flowcharts drawn from text. All three are part of the page, so they're end-to-end encrypted with everything else you write. That makes Notes a good home for internal runbooks and for formulas from research you haven't published.
Add a code block#
Insert the block
On a new line, type / and choose Code. Or type three backticks and a space, or press ⌘⌥8 (Ctrl+Alt+8 on Windows) to turn the current line into code.
Choose the language
Click the language label at the top of the block. It reads Plain text until you pick one. Type in Search languages to find it, such as
pyfor Python.Paste or type your code
Tab adds two spaces inside the block instead of moving to the next one.
The bar on the block has three buttons:
- Wrap lines keeps long lines inside the block instead of scrolling sideways.
- Line numbers shows a number beside each line.
- Copy code copies the whole block. People who can only view the page get this button too.
Wrap and line numbers are saved on the block, so everyone sees the same layout.
Add an equation#
Equations use LaTeX, the notation most math and science tools share.
- Type / and choose Block equation for a formula on its own line, or Inline equation for math inside a sentence.
- Type the LaTeX in the box. A preview appears underneath as you type.
- Click Done. For a block equation you can also press ⌘Enter (Ctrl+Enter on Windows). For an inline one, press Enter.
You can skip the menu. Type $$ and a space on an empty line for a block equation, or wrap math in single dollar signs, such as $x^2$, for an inline one. Leave no space just inside the dollar signs, so a price like "$5 and $10" stays text.
Some examples to start from:
\frac{a + b}{2}
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
E = mc^2To change an equation, click it. If the LaTeX has a mistake, Notes shows your text instead of the formula, with the hint "Check the equation syntax" when you hover over it.
Draw a Mermaid diagram#
Mermaid is a plain-text way to describe flowcharts and other diagrams. Notes draws the picture below the text and redraws it as you type.
- Type / and choose Mermaid diagram. Notes adds a starter chart with two boxes.
- Replace the text with your own. A small approval flow looks like this:
flowchart TD
A[Request received] --> B{Under budget?}
B -->|Yes| C[Approve]
B -->|No| D[Send to finance]- Check the drawing under the block. "The diagram has a syntax error." means a line needs fixing.
flowchart TD draws top to bottom. Use LR for left to right, square brackets for a box and curly braces for a decision. The Mermaid flowchart guide covers every shape and arrow. You can also turn any code block into a diagram by choosing Mermaid diagram in its language list. The drawing follows Notes' light or dark look.
For a diagram you'd rather drag around than type, use Foxcolab Whiteboard.
How they look in exports#
| Where | Code | Equations | Mermaid diagrams |
|---|---|---|---|
| Markdown export | Fenced code with its language | LaTeX between $ or $$ | The Mermaid text in a code block |
| HTML and PDF export | Code in a monospaced block | Formatted math | The Mermaid text in a code block |
| Published page | Code in a monospaced block | Formatted math | The Mermaid text in a code block |
Export a page from Page options (…) → Export. See Export notes and back up a workspace. A downloaded file isn't encrypted, so keep it somewhere safe.
Related#
- Foxcolab Notes keyboard shortcuts
- Get started with Foxcolab Notes
- How to make a flowchart online
- Create a free account and keep your technical notes end-to-end encrypted
Frequently asked questions
Which code languages does Notes highlight?
38 languages, including Bash, C, C++, C#, CSS, Go, HTML / XML, Java, JavaScript, JSON, Kotlin, Python, Ruby, Rust, SQL, Swift, TypeScript and YAML. Choose Plain text for no highlighting.
Do equations show up when I export a page?
Yes. HTML and PDF exports and pages you publish to the web show equations as formatted math. A Markdown export writes them as LaTeX between dollar signs, which most Markdown tools that support math can read.
Can I export a Mermaid diagram as an image?
No. Exports and published pages show the diagram's Mermaid text in a code block. Anyone with a Mermaid-aware tool can draw it again from that text.
Why does my equation show as plain text?
The LaTeX has a mistake, so Notes shows what you typed instead of the formula. Hover over it to see "Check the equation syntax", then click it to fix the text.
Did this answer your question?
One click, no account needed.
Still need help?
Our support team can take it from here.