Images
Images
Images use the ! short-function. The simplest form is just an exclamation mark and a path in brackets:
![photo.png]Where images are looked up
When you give just a file name (no slashes), Tachyonn looks for it in animg/ folder next to your .tac first, and falls back to the file sitting
directly beside the presentation. So the convention is to drop your images inimg/ and refer to them by name:
talk.tac
img/
photo.png ← ![photo.png] finds thisNeed a file somewhere else? Use a relative path (assets/photo.png,../shared/logo.svg) or an absolute one — those are resolved as written,
without the img/ lookup. Remote http(s):// URLs and data: URIs are left
untouched too.
Adding a caption
Put a caption after a comma. It appears beneath the image:
![chart.png, Figure 1: quarterly results]Modifiers: alignment and size
Often you want a bit of control over how the image sits on the slide. You add short modifiers in angle brackets, right before the path:
![<c> chart.png, A centered chart]The modifiers you'll use most:
| Modifier | Effect |
|---|---|
<c> | Center the image |
<l> | Align left |
<r> | Align right |
<f> | Make it full-width |
<w=N> | Set the width to N |
<h=N> | Set the height to N |
<p=N> | Space around the image, all four sides |
<pt=N> <pr=N> <pb=N> <pl=N> | Space on one side: top, right, bottom, left |
<px=N> <py=N> | Space on one axis: horizontal, vertical |
Combining modifiers
When you need more than one modifier, don't open several <…> blocks —
put the parameters in a single pair of angle brackets, separated by commas. A
right-aligned image 200 pixels tall:
![<r, h=200> portrait.png, A right-aligned portrait]Tips
This comma rule is general: any command that takes modifiers accepts several
parameters inside one <…>. <r, h=200> reads better than <r><h=200>.
Sizing and aspect ratio
A bare number means pixels (h=200 → 200px), but you can pass any CSS length
— w=50%, h=12vh, w=8rem.
- Give only
wor onlyhand the other dimension follows
automatically, so the image keeps its aspect ratio. - Give both and you pin both dimensions, which may distort the image.
![<w=320> map.png] // 320px wide, height scales to match
![<h=180> map.png] // 180px tall, width scales to match
![<w=320, h=180> map.png] // exactly 320×180 — ratio not preservedImages never overflow the slide: width is always capped at 100% of the
available space.
Space around the image
Sometimes the picture is the right size but sits too close to the text, or you
want to nudge it away from one edge. p= adds space around it; pt= / pr= /pb= / pl= do it one side at a time, and px= / py= handle an axis at
once. Same units as sizing — a bare number means pixels.
![<w=320, pb=2rem> chart.png] // breathing room below only
![<r, pl=3rem> portrait.png] // pushed away from the text on its left
![<c, py=1.5rem> diagram.png, A diagram] // space above and belowOnly the sides you name are touched — the others keep whatever the layout gives
them.
Why it doesn't shrink your image
The spacing is applied to the image's box, not to the <img>. So w=320
still means 320 pixels of picture, the caption moves along with it, and addingpl= never squeezes the image itself.
The named-attribute form
Modifiers are the quick way, but anything you can do with them you can also write out explicitly using the {...} attribute form after the brackets:
![photo.jpg]{align=center, width=320, caption="Aerial view"}The short modifier <c> and align=center mean exactly the same thing, <w=320> equals width=320, and the spacing keys have long forms too (padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingX, paddingY) — pick whichever reads better to you. Modifiers are faster to type; named attributes are more self-documenting.