Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (21 sloc) 2.36 KB
---
layout: post
title: LaTeX invoice package and MacTex
date: 2012-08-06 22:57:44
updated: 2014-01-14 22:53:00
proofread: yes
---
<div class="narrow-col">
<p>My invoices are generated from a LaTeX template using the <a href="../../assets/invoice.zip" title="Download the package (mirrored on this domain)">invoice package</a> by <span class="vcard"><span class="fn">Oliver Corff</span></span> (no longer available now). <span class="vcard"><span class="fn">Paul Asmuth</span> <a class="url" href="https://web.archive.org/web/20131215213244/http://paulasmuth.com/blog/latex_invoice/" title="HowTo: Write invoices in LaTeX">wrote</a> a little example on how to use the invoice package if you would like to try it out.</p>
<p>After installing OS X Mountain Lion and the most recent distribution of <a href="http://www.tug.org/mactex/" title="Download the MacTex distrubtion">MacTex</a> (<abbr title="2012-06-01">1 July 2012</abbr>), 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.</p>
<p>Still, generating an invoice with <em>pdflatex</em> kept producing the following error:</p>
<code>! LaTeX Error: Missing \begin{document}.</code>
<p>Turns out, there is a bug with an invoice dependency trying to load the <em>fp.tex</em> definitions causing the invoice package to produce this strange error:</p>
<code>l.31 \NeedsTeXFormat{LaTeX2e}[1995/12/01]</code>
<h2>RequirePackage</h2>
<p>Luckily it's easy to patch the problem. Have a look at the <em>/usr/local/texlive/2012/texmf-dist/tex/latex/invoice/invoice.sty</em> file and look for the line that requires the <em>fp</em> package in the &lsquo;initialize code&rsquo; block, near the beginning of the file:</p>
<code>\input{fp}</code>
<p>And simply replace it with:</p>
<code>\RequirePackage{fp}</code>
<p>Save the file and try running <em>pdflatex</em> again. Is it fixed now? Thanks to <span class="vcard"><a class="url fn" href="http://www.texdev.net/" title="Some TeX Developments">Joseph Wright</a></span> and his <a href="http://tex.stackexchange.com/questions/61113/using-graphicx-with-invoice-results-in-strange-pdf-output" title="Using graphicx with invoice results in strange PDF output">TeX StackExchange answer</a> for solving the issue!</p>
</div>
You can’t perform that action at this time.