Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to automate the creation of routine office correspondence - letters, etc. I am currently using Hotdocs for this task but would prefer to find something that isn't tied to Windows and something that could be more easily integrated into an automated workflow - e.g., could be used in a scripting environment.

I could roll my own with Perl/Python, and could probably adapt one of the HTML-oriented template systems to this task, but if someone's already done this, that'd be even better.

share|improve this question
I have written a script you may find useful, – ADP May 7 '15 at 11:17
Thanks, I'll take a look. – gbroiles May 7 '15 at 16:12
up vote 1 down vote accepted

Have you considered LaTeX? It's platform/OS agnostic and can produce output in in multiple document types. It has roots that go back to Donald Knuth who produced the initial forms of the Tex typsetting language to address challenges he saw in the production of his textbooks, particularly related to the presentation of mathematics.

LaTeX is very robust, has many package add ins for the dynamic production of in line graphics, formatting, flow control, typeface, etc... You could even use something like PHP to output the LaTeX formatted file for conversion to PS, PDF or other as a part of your document production chain.

You may want to take a look around The Tex forum on StackExchange to get a feel for some of the document production capabilities available.

share|improve this answer
I'm aware of the Tex family - hadn't considered it for this application because my perception is that it's more presentation/layout focused and because the limited exposure I've had to it suggests that it's very powerful but has a steep learning curve. I will explore it further and see if I was perhaps too hasty in rejecting it. Thanks for your suggestion. – gbroiles Sep 29 '11 at 20:25
Be sure to check out the Letter document template. – James Pulley Sep 29 '11 at 20:39
I've spent some time looking at tutorials, but I think my usage is a little different than others'. I would like to be able to use variable substitution - so I could write a template like 'Dear $NAME, I am writing to confirm your appointment on $DATE at $TIME' and have those bits replaced - and ideally include conditional logic, something like '<IF $MARRIED>Please bring your spouse. </ENDIF>' Is that among LaTeX's functionality? I get the impression that it's probably possible with macros but I don't want to be forcing it to do something it's not really meant to do. – gbroiles Sep 29 '11 at 21:38
We use PHP as part of the toolchain to generate the .tex file and post process that document for PDF output. In our case the output is that of performance test results which include lots of charts and graphs, but the source data and the format of the output is very consistent, lending itself to a programmatic solution for generating a report. In this model we keep a lot of the logic out of the LaTeX document, instead placing it in PHP template code. Using PHP also addresses the LaTeX weakness on the pull of data directly from the database. – James Pulley Sep 30 '11 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .