1

I would like to create a simple script (probably Python 3) to generate invoices based on *.tex template. Is there any way to change some data in this template from the command line? I mean, for example, such a simple situation that I want to run the script and give the amount for the invoice that would be inserted into it: "python generate_invoice.py --value 300$" and that 300$ will appear in a specific field in the resulting pdf file.

I couldn't find anywhere else to do that.

2
  • Why don't you just use a template engine to write 300\$ directly to the appropriate point in the latex file. Commented Aug 12, 2020 at 10:28
  • From the proposed duplicate in particular the highest voted answer (tex.stackexchange.com/a/1495) instead of the accepted answer, in your case that would be something like pdflatex "\def\amount{300} \input{invoicetemplate.tex}" where invoicetemplate.tex contains a line such as total: \amount or something like that. Commented Aug 12, 2020 at 10:31

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.