The vault
Attachments and files
Notes are rarely only text. A vault accumulates screenshots, scanned papers, photographs, lecture recordings, and PDFs, and Clew treats them as what they are: ordinary files in the folder, linked from notes the same way notes link to each other. This chapter covers the whole pipeline — pasting and dropping files into the editor, where they land and what they are called, how embeds render in reading mode, the built-in viewer tabs for media, and how to keep the accumulation organized.
Pasting and dropping
The fastest way to get a file into the vault is not to think about it. Copy an image anywhere — a screenshot, a picture from a web page, a chart out of another app — and paste it straight into the editor with ⌘V. Clew saves the image into the vault's attachment folder and inserts an embed at the cursor:
Inserted at the cursor
![[Pasted image 20260823142917.png]]
Dropping works the same way, and for any kind of file: drag one or more
files from Finder (or your platform's file manager) onto the editor,
and each is saved to the attachment folder and linked at the drop
position, one per line. Media files — images, PDFs, audio, video —
are inserted as ![[embeds]] so they render in reading
mode; any other file type gets a plain [[link]] instead.
What the file is called
A pasted clipboard image usually arrives with no useful name (the
clipboard calls everything image.png), so Clew names it by
timestamp: Pasted image 20260823142917.png — year, month,
day, hour, minute, second. A dropped file keeps its own name. In both
cases the name is sanitized (path separators and colons become dashes)
and deduplicated against the attachment folder: pasting
chart.png twice gives you chart.png and
chart 1.png, never an overwrite.
HEIC photographs
Photographs from an iPhone often arrive as HEIC, which Chromium — and
therefore Clew's reading mode — cannot display. On macOS, Clew
converts HEIC and HEIF files to JPEG transparently as they are saved,
so the vault only ever receives a .jpg. The conversion
preserves EXIF metadata, including GPS coordinates — which matters if
you use photo maps, where geotagged photos pin
themselves to an interactive map. If the conversion fails for some
reason, the original bytes are kept rather than lost.
How attachments are linked
Attachments are addressed exactly like notes: by name, with the vault
resolving where the file actually lives. ![[Earthrise.jpg]]
finds the file whether it sits in the vault root, in
Attachments/, or three folders deep — when several files
share a basename, the one with the shortest path wins, and you can
always write an explicit path (![[Attachments/Holiday/beach.jpg]])
to pick one out. Because bare names resolve regardless of folder, you
can reorganize the attachment folder later without breaking the embeds
that point into it.
A plain [[wikilink]] to an attachment (no !)
does not embed it; it renders as an ordinary link, and clicking it
opens the file in a viewer tab. The full link grammar — aliases,
headings, transclusion of notes — is covered in
Links and embeds; this chapter
sticks to what is specific to files.
Viewer tabs
Images, PDFs, audio, and video open as tabs in their own right — click
one in the file explorer, or click a [[link]] to one in
reading mode, and it opens in a viewer tab alongside your note tabs. A
viewer tab behaves like any other: it can be dragged into a split, kept
open next to the note that discusses it, and reopened from the tab's
history. PDFs open in Clew's own viewer — page navigation, thumbnails,
zooming, text search and selection, printing, and annotation.
Embedding media in notes
An embed is an attachment placed inside a note's rendered output. The syntax is Obsidian's: an exclamation mark before a wikilink, on its own line.
Images
You write
![[NASA - Earthrise.jpg]]
renders the image at its natural size, capped to the note's width.
Images take Obsidian's size syntax after a |: a width in
pixels, a width and height as
widthxheight, or alt text
followed by a size.
You write
![[clew-gradient.png|200]]
![[clew-gradient.png|300x200]]
![[clew-gradient.png|A stretched gradient|320x60]]
The rule for the segments after the name: only the last one
can be a size, and it must look like one — all digits, or
digitsxdigits. Anything else is treated as alt text, so
![[photo.jpg|The 1968 original]] is a caption, not a
mangled size. Videos accept the same size syntax; audio and PDFs
ignore it — a PDF takes its sizes in the link instead
(below).
PDFs
![[sample.pdf]] embeds the document itself inside a titled
box in the note — page through it, search it, and annotate it without
leaving the note. The box is as wide as the note's column and exactly
one page tall: the viewer opens at fit width, at the top of
page 1, and the next page begins just below the box's bottom edge, a
scroll inside it away. When the width changes — a split, a sidebar, a
resized window — the height follows. Reading mode and live edit are the
same. (In 0.12.0 an embed is 70% of the pane's height in reading mode and
a strip about 120 pixels tall in live edit, with the page shrunk to fit.)
Sizes, and the page to open at, go in the link, as in Obsidian:
You write
![[sample.pdf#height=600]] 600 pixels tall
![[sample.pdf#width=480]] 480 pixels wide, one page tall
![[sample.pdf#width=60%]] 60% of the column
![[sample.pdf#width=60%&height=600]] both, joined by &
![[sample.pdf#page=3]] opens at the top of page 3
![[sample.pdf#page=3&height=600]] page 3, 600 pixels tall
A height is in pixels (#height=50% is ignored); a width is
in pixels or a percentage of the note's column, and with a width alone
the embed is still one page tall, at that width. On the iPad an embed
takes the same sizes. With #page=3 the embed opens at the
top of page 3, still one page tall, so page 4 begins at its bottom edge;
a page past the end opens the last one, and a link edited to another page
goes there. The title shows just the file's name, and opens the full
viewer tab at that page too. (In 0.12.0 the link's sizes and page are
ignored — an embed always opens at page 1 — and the title shows them:
sample.pdf § height=600.)
The box's title is a link that opens the same file in a full viewer tab.
In reading mode a ⟷ button sits beside it that widens the
embed to the window and back, still one page tall and over any
#width: useful when you want the page and comment sidebars
beside the document rather than stacked below it, which is what happens
in a narrow column. Live edit has no ⟷: there the embed
keeps the column's width. (In 0.12.0 a widened embed is 88% of the
pane's height, and live edit shows a ⟷ too.)
A file EmbedPDF cannot open — not a PDF, or damaged — shows its own Error loading document card instead, and a PDF behind a password its Password Required prompt; the box is then as tall as that card, at any width — the card grows taller in a narrow column, and the box with it, so the prompt's field and buttons are never cut off. Type the password and the document opens in the same box, one page tall like any other.
A PDF a note embeds itself in raw HTML — an <iframe>,
<embed> or <object> pointing at a PDF
in the vault — opens in the same viewer, at the page a
#page=N asks for and at the size the HTML gives it, and so
does one that a note's own script adds after the page is drawn. A
relative path is read from the note's own folder and one starting with
/ from the vault's root; anything outside the vault, or not a
PDF, is left as written. A website export
keeps your HTML exactly as you wrote it.
A PDF a note embeds from the web — an
<iframe>, <embed> or
<object> whose address ends in .pdf, or
that says type="application/pdf" (an address like arXiv's
…/pdf/2401.01234 needs the type; without it the
browser's own PDF viewer shows it, with none of Clew's tools) — opens in
the same viewer, read-only. Clew fetches the file itself,
once, and keeps a copy on this device rather than in the vault, checking
it for changes at most once a day; a copy fetched before still opens
offline. A strip above the document offers Save a copy to the
vault, which puts it in your attachment folder as a file of your own
to annotate (a notice gives you the ![[…]] to embed it
instead), Open in browser, and Reload, which fetches it
again now.
Clew fetches as a stranger would: no cookies, no logins, nothing that says where the link was found. A PDF behind a sign-in therefore shows The site answered with a web page, not a PDF — it may need you to sign in; open it in your browser instead, and save it into the vault from there if you want it here. Local and private network addresses are never fetched, nor is a file over 100 MB, and the copies together are kept to about 1 GB, the least recently used going first. A web PDF opens the same way in a vault this device has not trusted, since it runs no code, and a website export keeps the note's original link.
Annotating
The viewer's Annotate tab gives you highlighting, ink, shapes, notes and stamps. Anything you draw is written into the PDF file itself a couple of seconds after you stop — there is no Save button to miss, and a small chip beside the filename tells you where things stand (unsaved, saving…, saved, or not saved — changed elsewhere, below). Switch away before then — another tab, closing the tab or the window, a note re-rendering over an embed — and the edit is written at once, the viewer kept alive out of sight until it lands. The one thing that does not wait is reloading the window (View → Reload), which discards an edit still pending.
Because the edit lands in the file rather than in a Clew-only sidecar, an annotation made here shows up in the viewer tab, on a canvas, in Preview.app, and on any other device the vault reaches. The same is true in reverse: annotate on an iPad and the marks are there when you open the note on your desktop. The three surfaces are three windows onto one file.
When the PDF changed elsewhere. Because annotations are
written into the file, one PDF can be changed in two places — annotated
on another device while it is open here, say, or rewritten by another
app. Clew never saves over a version the viewer did not load. If the PDF
changed elsewhere since you opened it, nothing is written: your
annotations are held, the chip reads not saved — changed
elsewhere, both versions are kept in the PDF's history (under
.clew/history/, by its path), and a sheet —
Paper.pdf changed elsewhere — asks what to keep:
- Keep mine
- Your version, with anything you annotated while it was held, is saved over the other.
- Keep theirs
- The viewer reloads the version on disk; yours stays in the history.
- Keep both, side by side
- Yours is saved beside it as
Paper (conflict 2026-10-04).pdf, the viewer reloads the other, and your copy opens in the pane beside it. There is no Compare… as there is for a note: a PDF has no lines to diff, so comparing is looking at both. - Later
- Nothing is saved, and a notice stays — Paper.pdf: your annotations are not saved — the PDF changed elsewhere. — whose Resolve… brings the sheet back.
This holds in every viewer — a PDF tab, an embed in a note, a card on a canvas. Close the viewer before choosing and the choice still works, from the versions kept in the history. A note changed in two places is handled the same way; see External changes and conflicts. (In 0.12.0 a PDF changed elsewhere was overwritten by the next autosave, unseen.)
With a pen (an Apple Pencil, or a stylus on a touch screen): once the pen has touched a PDF in a PDF tab or a note, a finger scrolls the document there while a drawing tool — ink, the ink highlighter, a shape or a line — is selected, and only the pen draws, so a resting palm or a scroll leaves no stray mark. Highlighting and the other tools that work on a selection or a tap still answer to a finger. A mouse is never affected, and nothing changes until a pen has been used. (On Windows pen-and-touch screens it has not been tested yet.)
Layers
Some PDFs carry layers — optional content the viewer can show or hide, common in CAD drawings, maps, and documents exported from design tools. Open the sidebar and choose the layers tab (the stacked squares) to see them: tick a layer to show or hide it, with the document's own grouping, ordering and radio-button relationships honoured. Showing and hiding changes only what you see — the file is not modified.
Clew can also create layers, which is where they earn their keep in a document that arrived with none. Add a layer in the panel and it becomes the home for new annotations — the highlighted layer is where new ink, highlights and notes go — so a first reading can sit on one layer and a second on another, or your marks apart from a colleague's. A selected annotation's toolbar has a layer button for moving it between layers, and hiding a layer hides the annotations on it. Deleting a layer asks what should happen to its content: keep it, delete it, or move it to another layer. Reset restores the visibility the document itself declares. Layer edits are saved into the PDF like any annotation, so they travel with the file — a viewer without layer support still shows the document, it just cannot switch the layers.
![[lecture.mp3]] renders an audio player;
![[Lumiere - Arrival of a Train (1895).webm]] renders a
video player with the usual controls. The demo vault's Media
Gallery note demonstrates both, public-domain film included.
Canvases
![[Demo Canvas.canvas]] embeds a live, read-only view of
a canvas — pannable and zoomable in place.
![[…]] must stand on its
own line. In the middle of a sentence, the ! renders
as a literal exclamation mark and the [[…]] becomes an
ordinary link — a useful fallback, but not an inline image. There
is no inline-embed form.
|300 and |300x200 size aliases, the
timestamped Pasted image names, and an attachment folder
of your choosing are all Obsidian conventions; a vault whose notes
embed media this way renders in both apps. Clew's HEIC-to-JPEG
conversion also mirrors what Obsidian users typically want, since
neither app can display HEIC directly.
Embeds in exports
When a note is exported to LaTeX or PDF,
image embeds become proper \includegraphics figures — a
pixel width from the size alias is converted to points — and an
embedded PDF is included the same way (which works for single-page
PDFs). Audio and video have no meaning on paper and are omitted.
PDF annotations as a note
What you highlight and note in a PDF can become a note you link to and
quote from. With the PDF's tab active, run PDF: extract annotations to
a note from the palette, or right-click the PDF in the file explorer
and choose Extract annotations to a note. Clew writes
<name> — Annotations.md beside the PDF: a
## Page N heading per page, and for each annotation a quote of
the text under it (read from the page itself), your comment, and a link
back to its page.
- Each entry ends in a block id,
^pdf-…, so another note can quote a single highlight:![[paper — Annotations#^pdf-…]]. - Run it again after more reading: annotations already in the note are left exactly as they are (write around them freely), new ones are added under their page, and nothing is ever removed.
- A link to a page,
[[paper.pdf#page=12]], opens the PDF at that page — from a note, from reading mode, or from the annotations note itself — beside the note, never in its place (see Following links). - Highlights, underlines, strike-outs and squiggles quote their text; sticky notes and free text bring their comment; ink says it has no text.
Quoting a passage
Select text in a PDF — in its tab, in a note's embed or on a canvas — and choose Quote in note from the viewer's own selection menu, or press ⌘⌥Q (also Edit → Quote PDF Selection in Note, and the palette's PDF: quote the selection in the note). Clew writes the passage into the note you are writing, as a quote with a citation and a link back to its page. (Not in 0.12.0.)
What goes into the note
> Conventions are equilibria in a game of coordination; their
> evolutionary dynamics are slow.
>
> \cite[p. 268]{skyrms:1996} · [[Skyrms.pdf#page=2|PDF p. 2]]
- The note is the one open in source mode or live edit — the active tab, or else the note you last edited. The quote goes in as a block of its own, after the block your cursor is in, so quotes taken one after another stack in order. A note in reading mode is never written into: switch it to source or live first.
- The text becomes one paragraph: a word broken by
a hyphen at the end of a line is joined, and anything the dialect
would read as markup — a
$, a^— is escaped, so the quote renders as the PDF reads. - The citation is the
.bibentry whosefilefield names this PDF (see the Library). When several entries name it, or none does, Clew asks which to cite — or to Quote without a citation; in a vault with no.bibfile the quote goes in without one, and the notice says why. With pandoc citations on, the citation is[@key, p. N]. - Your answer is remembered for that PDF in this
vault, so Clew asks once: it is kept in the vault's
.clew/pdf-citations.json, travelling with the vault (and never into a website export), and follows the PDF when you rename or move it. The first quote of a session that uses it says so in its notice. PDF: change the citation for this PDF… in the palette — for the PDF in the active tab, or the one last quoted from — asks again, with the current choice marked. A.bibentry whosefilefield names the PDF always wins over a remembered answer, and a remembered entry that is gone from every.bibasks again. - The page the citation names is the one the article prints — p. 268 — while the link after it is the PDF's own page, PDF p. 2, which is what opens. Clew reads the printed number from the numbers in the pages' headers and footers, else from the PDF's page labels (front matter stays as printed: xii), else uses the PDF's page and says so, once. The printed numbers come first because publishers' page labels are often wrong — some downloads are labelled a page ahead of what each page prints. If the number is wrong or missing, open the PDF at a page whose printed number you know and run PDF: set the printed page number… with that number, in digits: every page follows from it, an empty answer forgets it, and it is remembered for the PDF in this vault, like its citation. A quote without a citation still names the printed page: p. 268 · PDF p. 2.
- A PDF opened from the web cannot be quoted from: Save a copy into the vault and quote from the copy.
Non-media files
Any other file type — an archive or a data file, say — can live in
the vault and be linked with a plain [[name]], but Clew
has no viewer for it: clicking it in the explorer does nothing, and
the right-click menu's Reveal in Finder hands it to the
application that owns it. Three non-media families get special
treatment elsewhere: .canvas files open in the
canvas, .bib files feed
citation completion and bibliographies,
and Word, Excel and PowerPoint documents open — and edit — in
office tabs.
Where attachments live
Pasted and dropped files land in one folder, set in
Settings → Files → Attachment folder —
Attachments by default, created on first use. Nothing
forces attachments to stay there: an image sitting next to the note
that uses it works just as well, and subfolders inside the attachment
folder are fine (the demo vault keeps an Attachments/Holiday/
folder of geotagged photos for its photo map). Since embeds resolve by
name, the folder layout is an organizational choice, not a linking
constraint — pick a scheme and let the setting enforce it for
everything you paste from now on.
Reference
| Kind | Extensions | Embed renders as | Viewer tab | Size alias |
|---|---|---|---|---|
| Image | .png .jpg .jpeg .gif .webp .avif .svg .bmp |
Inline image | Yes | Yes |
.pdf |
Clew's PDF viewer in a titled box, one page tall (annotatable) | Yes | —; #height=, #width= in the link | |
| Audio | .mp3 .m4a .wav .ogg .flac |
Audio player | Yes | — |
| Video | .mp4 .webm .mov |
Video player | Yes | Yes |
| Canvas | .canvas |
Live read-only canvas scene | Canvas tab | — |
| Office | .docx .xlsx .pptx .odt .ods .odp |
Static thumbnail; |live for an editable LibreOffice |
Office tab (editable) | — |
| Anything else | — | Not embeddable; [[link]] only | No | — |
| Behaviour | Detail |
|---|---|
| Attachment folder | Settings → Files → Attachment folder; default
Attachments. |
| Pasted-image names | Pasted image YYYYMMDDHHMMSS.ext; dropped files
keep their names. |
| Name collisions | Deduplicated: x.png, x 1.png,
x 2.png… |
| HEIC/HEIF | Converted to JPEG on macOS as they are saved; EXIF GPS preserved. |
| Resolution | By basename, shortest path wins; explicit paths allowed. |
| Media embed | ![[file]] on its own line (an image may also sit
within a line, drawn in place; not in 0.12.0); plain
[[file]] opens the viewer instead. |
| PDF changed elsewhere | The save is held and both versions are kept in
.clew/history/; Keep mine, Keep theirs, Keep both
(side by side), or Later. Not in 0.12.0. |
See also
- Links and embeds — the full wikilink and transclusion syntax.
- Vaults and files — the explorer, file operations, and what renames rewrite.
- Interactive maps — photo maps built from geotagged attachments.
- The canvas — attachments as canvas nodes, and canvas embeds in notes.
- Exporting notes — how embeds carry over to HTML, LaTeX, and PDF.