{"id":28766807,"url":"https://github.com/sajjon/invoicelatex","last_synced_at":"2026-04-22T21:40:56.018Z","repository":{"id":296178292,"uuid":"992211416","full_name":"Sajjon/InvoiceLatex","owner":"Sajjon","description":"Pretty, maintenance-free and ENV-configured Invoicing in LaTeX + Lua.","archived":false,"fork":false,"pushed_at":"2025-06-05T05:49:41.000Z","size":455,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T12:04:39.885Z","etag":null,"topics":["invoice","invoice-generator","latex-template","lua"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sajjon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T19:45:15.000Z","updated_at":"2025-06-05T05:49:43.000Z","dependencies_parsed_at":"2025-05-29T11:10:35.323Z","dependency_job_id":null,"html_url":"https://github.com/Sajjon/InvoiceLatex","commit_stats":null,"previous_names":["sajjon/invoicelatex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sajjon/InvoiceLatex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sajjon%2FInvoiceLatex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sajjon%2FInvoiceLatex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sajjon%2FInvoiceLatex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sajjon%2FInvoiceLatex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sajjon","download_url":"https://codeload.github.com/Sajjon/InvoiceLatex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sajjon%2FInvoiceLatex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260355391,"owners_count":22996468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["invoice","invoice-generator","latex-template","lua"],"created_at":"2025-06-17T12:04:39.271Z","updated_at":"2026-04-22T21:40:56.009Z","avatar_url":"https://github.com/Sajjon.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaTeX Invoice\n\nA config **once**, inter-month-idempotent, calendar aware, capable and **maintenance-free** invoice solution written in LaTeX + Lua.\n\n# Features\n\n-   Config once: Set your company, client and project information using ENV vars in the `.envrc.secret` file (git ignored). **No LaTeX or Lua skills needed!**\n-   Inter-month-idempotent: You build the invoice any number of times, it always results in the same invoice number when run within the same month. The proceeding month the next invoice number will be used.\n-   Calendar aware: Using your machines system time to determine the month, it calculates the number of working days for the target month. Invoice date is set to last day of the target month and due date is set dependent on the payment terms set in your ENV config.\n-   Capable: Supports setting number of days you were off, to be extracted from the automatically calculated number of working days. Supports expenses using \"'\u003cPRODUCT0\u003e,\u003cCOST\u003e,\u003cQUANTITY\u003e';'\u003cPRODUCT1\u003e,\u003cCOST\u003e,\u003cQUANTITY\u003e'\" CSV inspired string.\n-   Maintenance free: The invoice number automatically set based on the current month. When you build the invoice the next month, the next number is used.\n\n# Requirements\n\nWith minimal modification this ought to work on Linux too, but I've only verified it on macOS.\n\n## `direnv`\n\nInstall [direnv](https://direnv.net/)\n\n```sh\nbrew install direnv\n```\n\nDirenv allows your system to automatically to load the environment variables standing in this projects.\n\n## LaTeX\n\nThere are two different ways of installing LaTeX on macOS. Either install [MacTeX](https://tug.org/mactex) which is a complete and very big distribution, which will eat up ~10 gb of your space. Use that if you have all that space to spare and want the easiest installation. Alternatively you can install TinyTex which is a much (typically 90%) smaller distribution. I recommend TinyTex since it is small and fast and it only has one extra required installation step which is fast and easy.\n\n## TinyTex\n\nInstall [LaTeX (TinyTex) here](https://yihui.org/tinytex/)\n\n```sh\ncurl -sL \"https://yihui.org/tinytex/install-bin-unix.sh\" | sh\n```\n\nYou will be prompted for your password.\n\nA package manager called `tlmgr` is now installed, we will use it in the next section to install some packages.\n\n### Install LaTeX Packages\n\nInstall the following packages:\n\n```sh\ntlmgr install babel-english fancyhdr arydshln lastpage datetime2 fp ragged2e xstring fancybox luacode threeparttable\n```\n\nLaTeX should now be setup!\n\n### Uninstalling MacTex\n\nIf you have previously installed MacTex and want to switch over to TinyTex, uninstall MacTex like so:\n\n#### Remove MacTeX package files\n\nRun this command in Terminal to remove the main MacTeX installation (typically 4-9 GB):\n\n```sh\nsudo rm -rf /usr/local/texlive\n```\n\n#### Remove the TeX Live utility symlinks\n\nThese links point to the binaries inside the MacTeX install.\n\n```sh\nsudo rm -rf /Library/TeX\n```\n\nYou may also want to remove any profile entries from:\n\n```sh\nsudo rm /etc/paths.d/TeX\n```\n\n#### Remove GUI apps installed by MacTeX\n\nThese may include:\n\n-   TeX Live Utility (/Applications/TeX)\n-   TeXShop (/Applications/TeXShop.app)\n\nYou can delete them manually from the `/Applications` folder.\n\n# Setup\n\nClone this repo, then cd to it.\n\n## Create `.envrc.secret`\n\nMake copy of [`.envrc.example`](.envrc.example) and call it `.envrc.secret`\n\n```sh\ncp .envrc.example .envrc.secret\n```\n\nReplace the placeholder values from [`.envrc.example`](.envrc.example) with your company, client and project values.\n\n## Source and make\n\nSource the updated environment variables by calling:\n\n```sh\ndirenv allow .\n```\n\nAnd now call make:\n\n```sh\nmake\n```\n\nWhich will call out to `lualatex`.\n\n# Usage\n\n\u003e [!NOTE]\n\u003e All environment variables references to in document are all set in `.envrc.secret` (which you should have copied over from `.envrc.example`).\n\u003e They will all be exported when you call `direnv allow .` (needed once and then after each change to `.envrc.secret`, which you typically only upon initial setup)\n\nBuild the invoice (`make` standing in the root of this project) on the first day month after the completed month. So if you have finished working in May, wait until June and build it. The invoice date will be set to `2025-05-31` and the due date will be set to `invoice day + $INVOICE_DAYS_DUE_AFTER_END_OF_MONTH`.\n\nSet `INVOICE_NUMBER_BASE_OFFSET = 42` if you have sent 42 invoices already and want the next to invoice to be 43, in order for this to work you need also set `INVOICE_NUMBER_BASE_OFFSET_DATE_MONTH` and `INVOICE_NUMBER_BASE_OFFSET_DATE_YEAR` to the previous month (and relevant year).\n\n\u003e [!NOTE]\n\u003e The invoice will be named \"\u003cINVOICE*MONTH\u003e\\_invoice*\u003cINVOICE_NUMBER\u003e.pdf\" and places in a folder next to the makefile called `invoices`.\n\u003e This name is inter-month-idempotent, running several times same month will use same name.\n\u003e Next month the next invoice will be generated with the subsequent month using the subsequent invoice number.\n\n## Did not invoice at all for some month?\n\nIf you were out of office (OOO) for an entire month, maybe due to parental leave or long vacation or long term sickness, you can set increment `INVOICE_NUMBER_MONTHS_FREE` by how many numbers of months you where OOO. This allows you to not have to \"hacky\" decrement your `INVOICE_NUMBER_BASE_OFFSET` to get the correct invoice number for the next month.\n\n## Out of office for **some** days?\n\nIf you were out of office for some days for the period you are invoicing you can call:\n\n```sh\nmake DAYS_OFF=5\n```\n\n## Expenses?\n\n```sh\nmake EXPENSES=\"'Sandwich,8.67,1';'Coffee,4.20,2'\"\n```\n\nOr if you had days of and expenses:\n\n```sh\nmake DAYS_OFF=2 EXPENSES=\"'Headphones,79.99,1'\"\n```\n\nWhich will subtract 5 from the number of working days that month (as calculated by the Lua script for you).\n\n# Example\n\nIf you build the invoice without changing any of the example values from [`.envrc.example`](.envrc.example), built with `make DAYS_OFF=3 EXPENSES=\"'Sandwich,8.67,1';'Coffee,4.20,2'\"` it will look like this:\n\n![Example](.github/assets/example_invoice.png)\n\n# How it works\n\n`direnv` will source [`.envrc`](.envrc) which in turn will source [`.envrc.example`](.envrc.example) and then if `.envrc.secret` exists, it will source that, effectively overriding the values of `.envrc.example`. If you haven't created `.envrc.secret` yet the values of `.envrc.example` are used instead, or if you were to comment out or remove any variable from `.envrc.secret`, that variable won't be overridden.\n\nThe LaTeX main file [`invoice.tex`](src/invoice.tex) will include other helper files, such as [`logic.tex`](src/logic.tex) which in turn wraps the lua functions inside [`logic.lua`](src/logic.lua) as LaTeX commands.\n\n# Contribute\n\nWe use `pre-commit` to run some soundness checks when you try to commit, such as checking for typos.\n\n## Precommit\n\nInstall [`pre-commit` CLI tool](https://pre-commit.com/):\n\n```sh\nbrew install pre-commit\n```\n\n## Install pre-commit hooks\n\n```sh\npre-commit install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsajjon%2Finvoicelatex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsajjon%2Finvoicelatex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsajjon%2Finvoicelatex/lists"}