← Overview

Embed an image from your vault as a figure in your document.

How you write it in Obsidian

![[system-levels.png]]

![[chart.png|Revenue by quarter]]

![Revenue by quarter](attachments/chart.png)

Supported: PNG, JPG/JPEG. GIF, BMP and WEBP are treated as PNG.

What Obsitex generates

\begin{figure}[!htbp]
    \centering
    \includegraphics[width=\textwidth]{./images/chart.png}
    \caption{Revenue by quarter}
    \label{fig:revenue_by_quarter}
\end{figure}

The exported file name comes from the file in your vault, the caption from what you wrote after the bar. Layout and scaling are controlled by the figureEnvironmentText field of your document setup.

Your caption is ordinary text, and it is treated as such. Special characters are safe, and the usual formatting works inside it:

![[chart.png|Costs_A and B & 50 % more]]

![[chart.png|A **bold** word in the caption]]
\caption{Costs\_A and B \& 50 \% more}

\caption{A \textbf{bold} word in the caption}

Bold, italic, links and citations therefore all work in a caption. The name the figure can be referred to is built from what you typed, never from the formatting, so no markup ends up inside it.

Caption and size

Obsidian uses one field for both the caption and the display size, and splits at the last vertical bar. Obsitex follows the same rule:

What you write Caption Size
![[image.png]] file name —
`![[image.png 300]]` file name
`![[image.png Revenue by quarter]]` Revenue by quarter
`![[image.png Revenue by quarter 300]]`
`![Revenue by quarter 300](image.png)` Revenue by quarter

Only a plain number (300) or width×height (300x200) counts as a size. Anything else stays part of the caption — so a caption may contain a vertical bar itself.