\usepackage{invoice}
Generate professional invoice PDFs with LaTeX — precise tabular layouts, automatic totals, logo placement, and consistent branding. Compile instantly in your browser or automate via the FormaTeX API.
\section{Why LaTeX}
Word processors and spreadsheets produce different output on every machine. LaTeX compiles to an identical PDF everywhere — perfect for billing documents that must be archived and reproduced exactly.
LaTeX's typesetting engine produces mathematically precise layouts — your invoice looks identical on every printer and screen.
Automate thousands of invoices from your database. Template once, generate forever.
Store invoice templates in Git alongside your code. Track every change, roll back any revision.
Produce PDF/A-compliant archives that satisfy legal record-keeping requirements for years.
\begin{longtable}
A complete single-page invoice with a branded header, bill-to block, itemised longtable with subtotal, tax, and total rows, plus bank payment details. Compiles with pdfLaTeX.
\documentclass[12pt, a4paper]{article}
\usepackage[top=2cm, bottom=2cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{microtype}
\usepackage{parskip}
\definecolor{accentblue}{RGB}{37, 99, 235}
\definecolor{rowgray}{RGB}{248, 249, 250}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\small\color{gray} Thank you for your business \textbullet{} Payment due within 30 days}
\begin{document}
% ── Header ──────────────────────────────────────────────────────────────────
\begin{minipage}[t]{0.55\textwidth}
{\fontsize{28}{32}\selectfont\bfseries INVOICE}\\[6pt]
{\color{accentblue}\bfseries FormaTeX Solutions Inc.}\\
123 Tech Street, Suite 100\\
San Francisco, CA 94105\\
{\small [email protected] \textbullet{} formatex.io}
\end{minipage}\hfill
\begin{minipage}[t]{0.40\textwidth}
\raggedleft
\textbf{Invoice\#:}\quad INV-2025-0042\\[3pt]
\textbf{Date:}\quad January 15, 2025\\[3pt]
\textbf{Due Date:}\quad February 14, 2025\\[3pt]
{\color{accentblue}\bfseries Status: Due}
\end{minipage}
\vspace{18pt}\hrule\vspace{12pt}
% ── Bill To ─────────────────────────────────────────────────────────────────
\textbf{Bill To:}\\[4pt]
Acme Corporation\\
Attn: John Doe, CFO\\
456 Corporate Boulevard\\
Los Angeles, CA 90001
\vspace{18pt}
% ── Line Items ──────────────────────────────────────────────────────────────
\begin{longtable}{>{}p{7.5cm} r r r}
\toprule
\rowcolor{accentblue}
\textcolor{white}{\bfseries Description} &
\textcolor{white}{\bfseries Qty} &
\textcolor{white}{\bfseries Unit Price} &
\textcolor{white}{\bfseries Amount} \\
\midrule
\endfirsthead
FormaTeX Pro Subscription (Annual) & 1 & \$299.00 & \$299.00 \\[4pt]
PDF Generation --- 50,000 documents & 50 & \$1.20 & \$60.00 \\[4pt]
Priority Support Package & 1 & \$99.00 & \$99.00 \\
\midrule
& & Subtotal & \$458.00 \\[2pt]
& & Tax (8.5\%) & \$38.93 \\[2pt]
\cmidrule(l){3-4}
& & \textbf{Total} & \textbf{\$496.93} \\
\bottomrule
\end{longtable}
\vspace{12pt}
% ── Payment terms ────────────────────────────────────────────────────────────
\begin{tabular}{lp{10cm}}
\textbf{Bank:} & First National Bank \\
\textbf{Account:} & 0042-8899-1234 \\
\textbf{Routing:} & 021000021 \\
\textbf{Ref:} & INV-2025-0042 \\
\end{tabular}
\end{document}\includegraphics{company-logo}
Add your company logo above the invoice header using \includegraphics. LaTeX accepts PNG, PDF, and EPS formats. Place the image file in the same directory as your .tex file, or provide an absolute path. Vector formats (PDF, EPS) produce the sharpest results at any print resolution.
\usepackage{graphicx}
% In the header minipage:
\begin{minipage}[t]{0.55\textwidth}
\includegraphics[width=4cm]{company-logo.png}\\[6pt]
{\color{accentblue}\bfseries Your Company Name}\\
Street Address, City, ZIP\\
{\small [email protected]}
\end{minipage}.pngGood for raster logos exported from Illustrator or Figma at 300 dpi
.pdfBest quality — embed vector artwork directly for infinite scalability
.epsLegacy vector format accepted by pdfLaTeX via epstopdf conversion
\newcommand{subtotal}
LaTeX does not compute arithmetic at compile time out of the box. The recommended pattern for invoices is to define totals as \newcommand macros — calculated once in your data pipeline or template engine — and reference them throughout the document. This keeps the source clean and makes programmatic generation trivial. For dynamic arithmetic in LaTeX itself, the pgfmath or spreadtab packages can compute sums directly, though they add compilation complexity.
% Define totals as commands for easy reuse
\newcommand{\subtotal}{458.00}
\newcommand{\taxrate}{0.085}
\newcommand{\taxamount}{38.93}
\newcommand{\totaldue}{496.93}
% Use in the table
& & Subtotal & \$\subtotal \\[2pt]
& & Tax (8.5\%) & \$\taxamount \\[2pt]
\cmidrule(l){3-4}
& & \textbf{Total} & \textbf{\$\totaldue} \\The full invoice template is pre-loaded and ready to compile. Edit the line items, swap the client name, and download a pixel-perfect PDF — no TeX Live installation required.
\input{api-data}
The FormaTeX API lets you generate invoice PDFs programmatically — pass your LaTeX template with interpolated data and receive a compiled PDF in the response. Scale from one invoice to millions without any infrastructure.
\end{invoice}
Open the invoice template in FormaTeX, customise it for your business, and compile a professional PDF in seconds — or connect the API to automate your billing pipeline.
One quick thing
We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.