Code and formulas
Notes include two kinds of blocks aimed at technical content: the code block, with syntax highlighting per language and an automatic code formatter, and mathematical formulas written in LaTeX, which appear both inline in the text ("Inline math") and highlighted on their own line ("Math block"). This page explains how to insert each one, how to pick the code language and format a snippet, and how to write and edit formulas — including the "Formula builder" with its symbol palette and formula library.
Code blocks
The code block displays snippets in a monospaced font and preserves indentation, ideal for keeping commands, configurations, and programming examples inside the note.
How to insert
- 1Type "/" where you want the snippet to open the insert menu.
- 2Start typing "code" to filter the list and choose "Code block".
- 3Alternatively, type three backticks (```) at the start of an empty line — it converts into a code block instantly.
- 4Paste or type the code inside the block.
Language and syntax highlighting
With the cursor inside the block, a floating bar shows the "Language" selector: a searchable list with the most common languages (JavaScript, TypeScript, Python, SQL, JSON, YAML, HTML, CSS, Bash, Rust, Go, LaTeX, and many more). Once the language is set, keywords, strings, numbers, and comments appear in different shades — and the color theme adapts automatically to light and dark mode. Without a language, the snippet stays readable, just without the coloring. When you paste code into a block that has no language, it is detected automatically when the match is confident — and the "Detect language" button on the bar runs the detection on demand.
Format code
Next to the language selector there is a "Format code" button. It formats the snippet deterministically (no AI involved) with the same tools code editors use: Prettier for JavaScript, TypeScript, JSX/TSX, JSON, CSS, SCSS, Less, HTML, Vue, Markdown, YAML, GraphQL, PHP and XML; clang-format for C, C++, Java and C#; gofmt for Go; ruff for Python; shfmt for Bash; plus dedicated formatters for SQL and Dockerfile. Rust, Kotlin, Swift, Ruby, PowerShell, VB.NET and VBA only get their indentation fixed (the code itself is not rewritten). Diff and plain text are not formatted, so the button stays disabled ("Formatting not available for this language"), and if the code has syntax errors nothing is changed — you just get a notice.
Copy, line numbers and wrapping
A "Copy code" button sits in the corner of the block, next to the language name, and also on the floating bar — it copies the whole snippet. The bar also toggles two options of the block: "Line numbers" and "Wrap long lines" (on by default). Both are saved with the note and apply to the published note too. The floating bar appears above the block; in a block taller than the screen it sits in the top corner of the visible part instead.
Mathematical formulas
Formulas are written in LaTeX, the standard notation for math, and rendered with high typographic quality. There are two forms: "Inline math", in the middle of a paragraph, and "Math block", highlighted on its own line.
Inline formula
Insert it through the "/" menu ("Inline math") or simply write the expression between dollar signs — it converts as soon as you close the second dollar sign:
$a^2 + b^2 = c^2$Click a rendered inline formula to edit its LaTeX in place; press Enter to confirm or Esc to cancel. The ƒₓ button next to the input opens the "Formula builder".
Math block
- 1Type "/" and choose "Math block" — or type two dollar signs ($$) at the start of an empty line.
- 2Double-click the block to type the LaTeX (Ctrl + Enter confirms, Esc cancels), or use the ƒₓ button to open the "Formula builder".
- 3Click the block once to select it: a floating bar appears with "Align left", "Align center", and "Align right", plus "Show as figure (with caption)".
- 4In figure mode, a caption field appears under the formula — useful for numbered equations in academic notes.
The Formula builder
The "Formula builder" is a helper window for anyone who does not write LaTeX by heart. It combines:
- A text area with the LaTeX expression and a live "Preview" underneath.
- A palette of buttons organized by category ("Structures", operators, Greek letters…) that insert the corresponding snippet.
- A searchable "Library" with about 180 well-known formulas — algebra, geometry, calculus, linear algebra, statistics, physics, chemistry, clinical medicine, finance and computing — ready to load and adapt.
- The "Insert" button, which puts the finished expression into the note.
LaTeX notation
Inline or in a block, the expression follows LaTeX notation. Some common patterns:
- Exponents
- Use "^" to raise — for example, x^2 for x squared.
- Subscripts
- Use "_" for a subscript — for example, a_1 for a-sub-one.
- Fractions
- Use \frac{numerator}{denominator} for a fraction.
- Greek symbols
- Write the name preceded by a backslash, such as \alpha, \beta, or \pi.