Anchors

Anchors allows creating links to a certain part of a note, such as referencing a particular heading or section within a note.

This feature was introduced in TriliumNext v0.94.0 and augmented in v0.103.0 to support linking across notes.

Interaction

  • To create an anchor:
    • Place the cursor at the desired position where to place the anchor.
    • Look for the  button in the Formatting toolbar, and then press the  button.
    • Alternatively, use Slash Commands and look for anchor.
  • To place a link to an anchor in the same note:
    • Place the cursor at the desired position of the link, or select the text to turn into a link.
    • Press Ctrl+K or the button in the Formatting toolbar, then select Heading / anchor at the top of the Add link dialog. Alternatively, choose Link to a heading or anchor in the Slash Commands, which opens the dialog on that page.
    • Under Anchors, click the desired anchor to check it. Optionally, type a Link title; without one, the link shows the anchor's name.
    • Press Enter or Insert link to confirm.
  • Clicking a link to an anchor of the same note scrolls to the anchor and briefly highlights the block that holds it, in read-only notes and on shared pages. While editing, clicking the link shows its popup, whose Jump to anchor button does the same, as do Ctrl+click and double-click.
  • To change a link to an anchor, place the cursor inside it and press Ctrl+K. Since v0.107.0, the Edit link dialog opens on Heading / anchor, with the linked anchor checked.

Linking across notes

Trilium v0.103.0 introduces cross-note Anchors, which makes it possible to create Internal (reference) links which point to a specific anchor in that document.

Compatibility with documents from previous versions

For notes created prior to Trilium v0.103.0, you might notice that the Anchors might not be identified. This limitation is intentional in order not to have to re-process all the notes, looking for anchors.

To fix this, simply go that note and make any change (e.g. inserting a space), this will trigger the recalculation of the links.

  1. Create an anchor in the target note using the same process as described above.
  2. In another note, press Ctrl+L to insert an internal link. Select the target note containing Anchors.
  3. The headings and anchors of the target note are listed below the Link title. Under Link to an anchor, click the desired anchor to check it.
  4. Add the link normally.

Clicking on a reference link pointing to an anchor will automatically scroll to the desired section.

Linking to anchors through the @ menu

Since v0.108.0, type @ in the text and pick the target note. Then type part of the anchor's name and press Enter, or select the anchor under Link to an anchor. See In-place linking.

Linking to anchors through the bookmark toolbar

  1. Create an anchor in the target note using the same process as described above.
  2. Click on the anchor to reveal the anchor's floating toolbar.
  3. Click on the Copy anchor reference link button.
  4. Go to the note where to insert the link and press Ctrl+V.