Home

Awesome

Invoice Boilerplate

Simple automated LaTeX invoicing system for freelancers.

Intro

Built along the lines of cv-boilerplate and letter-boilerplate, this boilerplate contains the bare minimum to produce a professional-looking invoice with the least possible effort.

preview

The invoice content lives in details.yml and it's structured like so:

invoice-nr: 2015-11-04
author: Max Mustermann
city: Musterstadt
from:
- Musterstraße 37
- 12345 Musterstadt
to:
- Erika Mustermann
- Musterallee 1
- 12345 Musterstadt
- Germany
VAT: 20
service:
- description: The first service provided
  price: 450.00
- description: And another one, with a list of details
  price: 245.00
  details:
    - Some more detailed explanation
    - of the service provided
    - Looking good
- description: The last service provided
  price: 245.00

When running make, Pandoc starts iterating on the YAML file, populates template.tex with your data, and pipes the result to XeTeX. XeTeX deals with the typesetting and compiles a PDF ready to be printed/faxed/emailed and archived (see the output).

The math gets handled internally by LaTeX through the spreadtab package, Excel-style (mad props to clemens on TeX SE for helping me out with this). You just need to provide a VAT rate and your prices, the boilerplate takes care of the rest.

Unless you plan to edit the template, no particular LaTeX knowledge is required to use this boilerplate. If you need your invoice in a language other than English, finding the relevant strings in template.tex and translating them to your language should be easy enough.

Dependencies

  1. LaTeX with the following extra packages: fontspec geometry ragged2e spreadtab fp xstring arydshln hhline titlesec enumitem xunicode xltxtra hyperref polyglossia wallpaper footmisc
  2. Pandoc, the universal document converter.

I highly recommend TinyTeX as LaTeX distribution. All additional packages can be installed with tlmgr as needed.

Getting started

  1. Open details.yml with your text editor and fill it with your details, the invoice recipient's details, services/prices, and the desired settings.
  2. Run make to compile the PDF.

Some countries require invoices to be signed. If a file named signature.pdf is present in the directory, the boilerplate will automatically print it after the closing note as a final touch. Follow this method to import your own signature.

Note: this template needs to be compiled with XeTeX.

Note for Windows users

Although I didn't test it, you can probably use this on Windows, too. Both Pandoc and LaTeX can be installed on Windows and you should be able to run makefiles on Windows through Cygwin. If that's too much hassle, this command should do the trick in Powershell:

pandoc details.yml -o output.pdf --template=template.tex --pdf-engine=xelatex

Available settings

Custom letterhead

If you have already designed your own letterhead and want to use it with this template, including it should be easy enough. Set the letterhead option to true to activate the wallpaper package in the template. wallpaper will look for a file named letterhead.pdf in the project root folder and print it on the PDF before compiling the document. Change the fonts to match the ones in your letterhead, adjust the margins with geometry and you should be all set.

Recommended readings

Resources

See also

License

GPL