Reference

Every option the invoice format accepts.

The complete invoice configuration: sender and recipient, the invoice block and its line items, bank details, currency handling, and validation.

Using the format

format: invoice-typst
quarto render invoice.qmd --to invoice-typst

The document

Options outside the three blocks.
Option Description
title Set above the totals table, as a heading.
description Set under the title, in italics. Read only when title is set.
logo A path to an image, set beside the invoice details. Falls back to brand.logo.
papersize The paper. a4 unless set.
margin A mapping of Typst page margins, x and y by default.
lang, region Passed to Typst, and lang also chooses the number separators.
mainfont, fontsize Fall back to brand.typography.base.family and .size.

Sender and recipient

Both are required, and rendering fails without them.

The two parties.
Option Description
sender.name Required.
sender.email Set as a mailto: link.
sender.registration Company registration number.
sender.vat VAT number.
sender.exempted The wording of a VAT exemption notice, set in grey under the totals.
sender.address street, zip, city, state, country.
recipient.name Required.
recipient.address The same address fields.

The invoice block

Required, along with invoice.number, invoice.issued, and invoice.due.

The invoice block.
Option Default Description
invoice.number The invoice number.
invoice.issued Issue date, as YYYY-MM-DD.
invoice.due Due date, as YYYY-MM-DD.
invoice.reference A payment reference for the transfer. Set in the bank block, so it appears only when bank is given.
invoice.currency EUR An ISO 4217 code, GBP for example.
invoice.fee 2.28 A late payment fee, as a percentage.
invoice.penalty €40 Recovery costs, set as written.
invoice.items The line items. See below.
Warning

invoice.penalty reaches Typst as a string whatever it is written as, so a number is set as a bare figure rather than in the invoice currency: penalty: 40 on a GBP invoice reads 40, not £40. Write the amount with its symbol, as penalty: "£40". The default when it is left out is the literal €40, in every currency.

Line items

invoice:
  items:
    - description: Strategy workshop
      details: Two-day on-site facilitation.
      quantity: 2
      unit-price: 1500
      vat: 20
The fields of a line item.
Field Default Description
description A short description. Required.
details A longer one, set below the item.
quantity 1
unit-price 0 Excluding VAT.
vat 0 The rate, as a percentage.

The subtotal excluding VAT, the VAT, and the grand total are computed from these. A quantity that is a whole number is set without a decimal part, and the VAT rate is set as a whole percentage.

Note

Leave invoice.items out and the body of the document is rendered in its place instead, which is how a hand-written Typst table is kept working.

Bank details

bank.bic and bank.iban, set under a payment heading at the foot of the page along with invoice.reference.

Important

Both keys have to be present. An invoice with no bank block fails to compile, so give the block even when the payment details are not yet known.

Currency

Amounts are formatted with the decimal and thousand separators of the document’s lang, so the same figures read correctly in English and in French.

Twenty-six ISO 4217 codes carry a symbol, EUR, USD, GBP, JPY, and CHF among them. A code with no symbol is set as the code followed by a space.

SEK, NOK, DKK, PLN, CZK, and CHF put the symbol after the amount; every other currency puts it before.

Validation

Important

invoice.issued and invoice.due must both be YYYY-MM-DD, and invoice.due must fall on or after invoice.issued. Either mistake raises an error while rendering rather than producing a document nobody would notice was wrong.

Branding

The format reads _brand.yml for the logo, the base font and size, and the heading family, weight, style, colour, and line height:

brand:
  typography:
    fonts:
      - family: Alegreya Sans
        source: google
    base:
      family: "Alegreya Sans"
      size: 12pt
    headings:
      family: "Alegreya Sans"
      color: dodgerblue

A self-contained example lives under examples/ in the repository.

Limitations

  • PDF through Typst only.
  • The totals table is generated from invoice.items; mixing it with a hand-written table means choosing one or the other.
Back to top