Skip to content

Links and images

Markdown

A Markdown link: [Obsidian](https://obsidian.md).

A bare URL: https://pandoc.org

An autolink: <https://github.com>

A link with a title: [WeasyPrint](https://weasyprint.org "PDF engine").

PDF

Markdown links and URLs

  • A Markdown link and an autolink in angle brackets become links in the PDF.
  • A bare URL stays plain text. Pandoc's reader does not turn it into a link, while Obsidian does. Wrap it in <...> to get a link.
  • In print, links have the text colour. Links between pages of the export are wiki links.

Images

Markdown

An image followed by a single italic line:

![[chart.png|320]]
*The italic line becomes the caption.*

A caption written in the embed:

![[chart.png|Visits per month|240]]

PDF

Images with captions

  • An image is at most as wide as the text and never split across pages.
  • A Markdown link to a note, such as [text](Page.md), works like a wiki link.
  • A single italic line right below an image becomes its caption.
  • Image sizes and the full embed syntax are on the Embeds page.

Local images

Markdown

A path relative to the folder of the note:

![Visits per month](../_attachments/chart.png)

A width after the alt text:

![Visits per month|200](../_attachments/chart.png)

An HTML image:

<img src="../_attachments/chart.png" width="120">

PDF

Markdown images with relative paths

  • The path of ![alt](path) and of <img src="../path"> is looked up from the folder of the note it is written in, as in Obsidian. In an embedded note, that is the folder of the embedded note.
  • A path that starts with / is looked up from the vault root. When the path does not exist, the file name is looked up in the whole vault, as for ![[image.png]].
  • Encoded characters (my%20chart.png) and paths in angle brackets (![alt](<my chart.png>)) work. A title (![alt](path "Title")) is kept.
  • A width or a width and height after the alt text, ![alt|300](path) or ![alt|300x200](path), sets the size, as in Obsidian.
  • Images with a URL, such as https://... or data:..., stay as written.
  • A Markdown image that cannot be found becomes the italic text [Image: path], an HTML image stays as written. Both give a warning.