Skip to content

Images ​

Typoteka gives images a few book-oriented behaviors on top of standard Markdown.

Figures and captions ​

A paragraph that contains only an image with alt text becomes a <figure>, using the alt text as its <figcaption>:

markdown
![A caption for the figure](images/photo.png)

Images without alt text stay inline in the surrounding text.

Outer images ​

Wrap an image in ::: outer to make it break out of the column flow and fill the full text-block width:

markdown
::: outer
![Caption text](images/photo.png)
:::

To the edge of the page ​

An image can reach the page's edge (the trim), or past it into the bleed, on any of its four sides. The sides are the top, the bottom, the inside (the spine) and the outside: the outside is the left on a left page and the right on a right page, and is worked out once the book is laid out. Name them as classes of the image's block:

ClassThe image reaches
bleedThe bleed, on the four sides.
bleed-top, bleed-bottom, bleed-inside, bleed-outsideThe bleed, on that side.
trimThe trim, on the four sides.
trim-top, trim-bottom, trim-inside, trim-outsideThe trim, on that side.
markdown
::: outer bleed-outside
![](images/photo.png)
:::

::: outer bleed-top bleed-outside
![](images/photo.png)
:::
  • Inside and outside: the image grows past the text block on that side, by the page's margin, and for bleed also by the book's bleed. It keeps its proportions, so it also grows taller. It is measured from the text block's edge: use it on a block that reaches that edge, such as ::: outer.
  • Top: the block starts a new page and rises to the top edge. The text after it follows it on the same page.
  • Bottom: the block ends its page and goes down to the bottom edge, leaving any room above it. Its caption is not shown: it would be under the image, off the page.
  • Top and bottom: the image takes a page of its own, as a cover does (see below). ::: outer bleed is such a page.

A side named on its own wins over the four: ::: outer bleed trim-inside reaches the bleed everywhere but the spine. An image that reaches an edge is drawn without the border, rounded corners or shadow a style gives images.

The book's bleed is set in the status bar, next to the bleed guide (3mm by default, bleed in typoteka.json). On screen, a page is cut at the trim; with the bleed guide shown, what reaches into the bleed is shown too, under the guide's tinted band, and a line marks the trim, where the PDF cuts the page. Save PDF cuts every page at the trim, and Save PDF for print includes the bleed (see Exporting a PDF).

Covers ​

::: cover puts an image on a page of its own, edge to edge: the page has no margins, no running head and no page number, and the image fills it to the trim, cropped where its proportions differ from the page's. Every style has it.

markdown
::: cover
![](images/cover.png)
:::

The text before the block ends its page, and the text after it starts a new one. Put it first for a front cover, or last for a back cover.

The image's alt text is not shown as a caption on the cover. Anything else in the block, such as a title, is drawn over the image from the top of the page:

markdown
::: cover
# The Drowned Cloister

![](images/cover.jpg)
:::

The D&D 5e styles set that title in their own lettering, centred and white. In the other styles it keeps the look of the style's headings, and a style of your own can place it (see Your own style).

The image stops at the trim. To reach into the bleed, add bleed (the four sides) or the sides by name, as in To the edge of the page: ::: cover bleed, or ::: cover bleed-outside for a back cover whose spine side stops at the trim.

Images in columns ​

In a style or a passage set in columns, an image is as wide as its column. To make it wider:

BlockThe image takes
::: spanEvery column. Works for anything, not only images.
::: outerEvery column, the full width of the text block.
::: outer bleed-outsideEvery column, and past the text and the outer margin into the bleed.
::: span-2, ::: span-2-rightTwo columns, at the left or the right, at the top of the page (-bottom: the foot). See Two of the columns.

Tall images ​

An image taller than a page is made narrower, keeping its proportions, until it and its caption fit on one page. Without that, it could leave a blank page before it, land on a page apart from its caption, or not be shown at all. It is on by default: Project Settings → Advanced → Fit tall images on a page. A page without margins (a cover) is left alone: there the image fills the page, and what does not fit is cut off.

An image that does not fit on what is left of a page moves whole to the next one, with its caption. For an image across the text block (::: outer), that is Project Settings → Advanced → Move images that do not fit at the foot, on by default.

Notes ​

An image that reaches the bleed is laid out at the bleed's size: changing the bleed lays the book out again.