Suffix

LaTeX invoice package and MacTex

Generating invoices in LaTeX.

My invoices are generated from a LaTeX template using the invoice package by Oliver Corff (no longer available now). Paul Asmuth wrote a little example on how to use the invoice package if you would like to try it out.

After installing OS X Mountain Lion and the most recent distribution of MacTex (), my invoices wouldn't generate any more. I checked the invoice package in the TeX Live Utility and sure enough, it was installed by default and updated to the latest version the TeX Live Utility could find.

Still, generating an invoice with pdflatex kept producing the following error:

! LaTeX Error: Missing \begin{document}.

Turns out, there is a bug with an invoice dependency trying to load the fp.tex definitions causing the invoice package to produce this strange error:

l.31 \NeedsTeXFormat{LaTeX2e}[1995/12/01]

RequirePackage

Luckily it’s easy to patch the problem. Have a look at the /usr/local/texlive/2012/texmf-dist/tex/latex/invoice/invoice.sty file and look for the line that requires the fp package in the ‘initialize code’ block, near the beginning of the file:

\input{fp}

And simply replace it with:

\RequirePackage{fp}

Save the file and try running pdflatex again. Is it fixed now? Thanks to Joseph Wright and his TeX StackExchange answer for solving the issue!